line-plot

How to plot groups of line plots from multiple files

How to plot groups of line plots from multiple files Question: I have two files one.txt and two.txt which contains two columns and three rows as A.txt A B C 1994 4 6 1996 8 10 1998 10 14 and B.txt as A B C 1995 14 2 1997 18 5 1999 12 9 I …

Total answers: 1

Combine Binned barplot with lineplot

Combine Binned barplot with lineplot Question: I’d like to represent two datasets on the same plot, one as a line as one as a binned barplot. I can do each individually: tobar = pd.melt(pd.DataFrame(np.random.randn(1000).cumsum())) tobar["bins"] = pd.qcut(tobar.index, 20) bp = sns.barplot(data=tobar, x="bins", y="value") toline = pd.melt(pd.DataFrame(np.random.randn(1000).cumsum())) lp = sns.lineplot(data=toline, x=toline.index, y="value") But when I try …

Total answers: 1

how can I plot some graphics from data in a given dataset?

how can I plot some graphics from data in a given dataset? Question: I have a dataset containing data on covid cases. the link is as follows i have a 3 questions waiting to be answered: Pie chart of the top 10 countries with the highest number of cases and deaths per million. Stackplot visualization …

Total answers: 1

Time series plot with Seaborn Lineplot

Time series plot with Seaborn Lineplot Question: I need to format the x-axis labels for the sns.lineplot in the format (Month-YYYY, eg. Mar-2006, Jun-2006 and so on..). I tried the below code below it is not giving me the desired output. Any help will be much appreciated. Thanks! Code Snippets import pandas as pd import …

Total answers: 1

Plotting multiple lineplots on single plot with for loop using matplotlib

Plotting multiple lineplots on single plot with for loop using matplotlib Question: I have a list of about 200 dataframes that look like this: I’m running these dataframes through a for loop that runs a linear regression on each one and generates some error metrics. I’d like to generate a single plot that has all …

Total answers: 1

Draw path on heatmap Python

Draw path on heatmap Python Question: I have a vector x with length N=n**2=625 which I simply plot with imshow by reshaping into a matrix, which is essentially a 2D topographical map. plt.imshow(x.reshape((n,n)),cmap="magma",origin="lower") I also have a given connected path with the some indices of the vector x, e.g path = np.array([1, 2, 27, 28, …

Total answers: 1

lineplot not giving the desired results

lineplot not giving the desired results Question: Scenarios Node-0 Node-1 Node-2 Node-3 Node-4 Node-5 Original System 1 1 1 1 1 1 Leak_Node_1 1 0.043 1 1 1 0.0043 Leak_Node_2 1 1 1 1 1 0.012 Leak_Node_3 1 1 1 1 1 0.0086 Leak_Node_4 1 1 1 1 1 0.0085 Leak_Node_5 1 1 1 1 …

Total answers: 2

Highlight a single point with a marker in lineplot

Highlight a single point with a marker in lineplot Question: I would like to highlithgt a single point on my lineplot graph using a marker. So far I managed to create my plot and insert the highlight where I wanted. The problem is that I have 4 differents lineplot (4 different categorical attributes) and I …

Total answers: 1

How to plot multiple lines with different X indices

How to plot multiple lines with different X indices Question: I have 3 data frames as so: Range is the index second Column is Number print(df1) Range 1.27 2386.0 0.93 5598.0 1.27 3607.0 1.29 2262.0 0.94 12227.0 print(df2) Range 1.26 6410.0 1.27 5688.0 1.25 7329.0 0.93 7757.0 1.26 2118.0 1.26 5772.0 print(df2) Range 0.92 3368.0 …

Total answers: 1

Can you plot interquartile range as the error band on a seaborn lineplot?

Can you plot interquartile range as the error band on a seaborn lineplot? Question: I’m plotting time series data using seaborn lineplot (https://seaborn.pydata.org/generated/seaborn.lineplot.html), and plotting the median instead of mean. Example code: import seaborn as sns; sns.set() import matplotlib.pyplot as plt fmri = sns.load_dataset(“fmri”) ax = sns.lineplot(x=”timepoint”, y=”signal”, estimator = np.median, data=fmri) I want the …

Total answers: 4