Skip to main content

All Questions

Tagged with
0 votes
0 answers
22 views

How to plot date data from my pandas dataframe [duplicate]

Hey im a beginner struggling to plot a date (x-axis) vs a float (y-axis). Im struggling to understand the matplotlib documentation around dates or find an answer on SO. I have a pandas dataframe with ...
IceRoss's user avatar
9 votes
3 answers
430 views

How to plot polygons from categorical grid points in matplotlib? (phase-diagram generation)

I have a dataframe that contains 1681 evenly distributed 2D grid points. Each data point has its x and y coordinates, a label representing its category (or phase), and a color for that category. ...
Shaun Han's user avatar
  • 2,797
0 votes
0 answers
34 views

matplotlib/pandas multiple boxplots with an additional subplot

I would like to create 5 boxplots from a pandas dataframe and add an additional plot with a bar chart to create a full 3x2 matrix of plots. However, I am getting an error in several approaches. Try #1:...
Rachel W's user avatar
  • 137
0 votes
1 answer
55 views

pandas bar chart with paired columns

I have a DataFrame with paired columns. I want to plot it such that each pair of columns has a unique color, and one column of each pair has an empty fill. I tried this: import pandas as pd df = pd....
Ilya's user avatar
  • 553
2 votes
1 answer
62 views

Unusual Memory Error when plotting line on secondary y axis using Pandas/Matplotlib

I'm getting the following memory error when adding a line to the secondary axis: MemoryError: Unable to allocate 48.2 GiB for an array with shape (1726364447,) and data type [('val', '<i8'), ('maj',...
Bill's user avatar
  • 11.7k
0 votes
1 answer
72 views

fill_between plot fails on specific index value combo for a pands time-series

I try to do a plot and observe a strange error: import pandas as pd import matplotlib.pyplot as plt idx = pd.TimedeltaIndex(['0 days 00:00:00', '0 days 06:00:00', '0 days 12:00:00', '0 days 18:00:00']...
CodeNStuff's user avatar
1 vote
3 answers
66 views

Conditional marker for scatterplot Matplotlib

I am trying to plot x1 and x2 against each other, and if class == 1, then marker should be +, if class == 0, then the marker should just be a dot. The file.csv is structured like this, the class ...
Hiro's user avatar
  • 56
0 votes
0 answers
121 views

Matplotlib Assertion Error when plotting in Jupyter Lab Notebook

UPDATE (2024/09/21): I have changed pd.DataFrame.boxplot for pd.DataFrame.plot.box functions and restarted the Jupyter server. Now, it works repeatedly. No issues like before arise. (I believe there ...
Mike C's user avatar
  • 1
3 votes
1 answer
70 views

Plotting a timeseries as bar plot with pandas results in an incorrect year

I have the following dataframe (except my actual data is over 25 years): import pandas as pd df = pd.DataFrame( dict( date=pd.date_range(start="2020-01-01", end="2020-12-31&...
kdheepak's user avatar
  • 1,366
-1 votes
1 answer
91 views

Given a table with a value z and polar coordinates (r, phi), how can I use matplotlib to plot these values on a polar grid?

I have a pandas dataframe with three columns. The first column is value z, and the other two columns are polar coordinates (r and phi, respectively, where phi is assumed degrees). r and phi are whole ...
Nicole I.'s user avatar
0 votes
0 answers
44 views

Matplotlib plotting plt.plot(t,y) VS df.plot(y)

what's the problem, why the these two versions of code do not produce the same graphs ? they are just reversed in order. My df.index is a date_time object and Y_FIT['BFGS'] is an array. CODE 1 : plt....
Artashes's user avatar
  • 128
0 votes
1 answer
50 views

Plotting multivariable plot in seaborn using Pandas DataFrame

Reproducing the data frame as showed : dx = {'SEGM':[9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 'YES':[4812, 2697, 2677, 1811, 1570, 1010, 418, 210, 115, 166], 'NO':[590, 1368, 2611, 2968, 3942, 3596, 2141, 1668, ...
Nabi Shaikh's user avatar
2 votes
1 answer
73 views

How to plot rows containing na's in stacked bar chart python?

I am still an absolute beginner in python and I googled a lot to built code to make a stacked bar chart plot my df. I am using spyder and python 3.12 After some data preparation, I am left with this ...
mr.raccoon's user avatar
0 votes
1 answer
387 views

How to plot multiple data sets imported from excel worksheet in matplotlib?

I need help with plotting the data from excel into matplotlib. The data is taken from one worksheet. The columns have similar structure:column a -x values, column b - y values, column c - x values, d -...
Olgak's user avatar
  • 11
0 votes
1 answer
57 views

How do i add a subplot to an existing FacetGrid?

i have 10 times measured data i want to plot in a specific way. The easy part was this: facetgrid = sns.lmplot(data=file_to_plot, col="count", col_wrap=3, x='measured_data', y='y_data') plt....
Alexander Mutz's user avatar

15 30 50 per page
1
2 3 4 5
82