Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
3 votes
1 answer
39 views

How to plot justify bar labels to the right side and add a title to the bar labels in Python's matplotlib?

I have created a chart in matplotlib in python, but the last line in the following code doesn't allow alignment of the bar labels outside of the graph. import matplotlib.pyplot as plt g=df.plot.barh(x=...
userneedhelp029848's user avatar
4 votes
2 answers
54 views

How to add legend to df.plot/legend not showing up df.plot()

I am currently creating a scatter plot with the results of some evaluation I am doing. To get a dataframe of the same structure as mine you can run: import pandas as pd models = ["60000_25_6&...
Caden's user avatar
  • 67
0 votes
0 answers
27 views

matplotlib plot dataframe with two columns, one is date, another one is text [duplicate]

This question could be simple to you but I couldn't figure out. I have a pandas dataframe with information of date column DATE and a text column LOC. DATE LOC 2018-02-24 ANA#1 2020-06-01 ...
Brom's user avatar
  • 203
-2 votes
1 answer
25 views

Change format of xaxis labels in pyplot [closed]

I'm trying to reformat the x-axis and nothing I'm trying is working when I use: import pandas as pd import matplotlib.pyplot as plt z = pd.DataFrame([[2000,1,2],[2001,2,3],[2004,5,6]]) z=z.set_index(0)...
greylock's user avatar
-2 votes
0 answers
27 views

Matplotlib table header coloring

Matplotlib table header I am having an issue with formatting a table in Matplotlib. I am auto formatting the cells to fit the text size and trying to add a header above the last 4 columns in the table....
Steven MacDonald's user avatar
0 votes
1 answer
42 views

Change y axis scaling on a Seaborn Heatmap

I am at the final stage of displaying a heatmap within a facetgrid. When I am presenting the data, some of the index values may or may not be present for the row / column combination. I would like to ...
sxs's user avatar
  • 59
0 votes
1 answer
58 views

Is there a function to create heatmap with the same parameters as ax.plot?

I have two very large arrays (80,000+ elements) that i want to create a heatmap for, just like ax.plot draws out the graph but with heatmap values. matplotlib's heatmap is an obvious answer but it ...
Wave's user avatar
  • 13
2 votes
1 answer
62 views

How to plot a line on the second axis over a HORIZONTAL (not VERTICAL) bar chart with Matplotlib?

I know how to plot a line on the second axis over a VERTICAL bar chart. Now I want the bars HORIZONTAL and the line top-to-bottom, just like the whole chart rotates 90°. If I simply replace bar with ...
chaosink's user avatar
  • 1,433
0 votes
0 answers
19 views

Setting title in displot for each subplot

I want to set the title of each graph to be the crop type and the interval it is looking at. # Load the CSV files df_corn = pd.read_csv(r"D:\Final Prep\Everything\WUVR_corn.csv") df_soy = ...
Ekkehardt Rosasee's user avatar
0 votes
1 answer
48 views

Change color for displot based on column

I have a displot: I want the data for Corn to be a different color (say Red and Green) and the data for soy to be (Orange and Blue) df_melted = {'Sink_ID': ['100012_HUC8_09020204', '...
Ekkehardt Rosasee's user avatar
0 votes
0 answers
27 views

How can you use axvspan to show missing datetime data?

I am plotting data showing the water surface elevation of a creek over a 16-year time span. The data are provided in 15-minute increments, but there are missing time periods, including one that lasted ...
Juancheeto's user avatar
0 votes
1 answer
47 views

No lines between datapoints in pyplot

I'm trying to make a simple line plot with matplotlib.pyplot but i don't get lines between datapoints. I have a pandas DataFrame with a DateTime index and I want a subplot for each weekday. Everything ...
Tim Bgel Timster2k's user avatar
-2 votes
1 answer
51 views

Sklearn module missing and unsure what to use instead?

I'm currently following this guide https://www.geeksforgeeks.org/rainfall-prediction-using-machine-learning-python/ However. I am getting this error for the following lines of code. for i in range(3): ...
John.R's user avatar
  • 3
-3 votes
0 answers
31 views

Stacked and Grouped 3x2 plt subplot of bar charts from MultiIndex df

Attempting to construct a plt.subplot(nrows=2,ncols=3) stacked, grouped bar chart on a DataFrame with a MultiIndex area_fips object year int32 qtr int32 where col sector (for ...
Vijay Tripathi's user avatar
0 votes
2 answers
50 views

Python Pandas how to plot multiple colmuns on x axis?

I have a dataframe that looks like this: import pandas as pd data = {'Floor': [1, 2, 3, 4], 'IDR 1': [15, 6, 7, 9], 'IDR 2': [36, 12, 78, 23]} df = pd.DataFrame(data) df: Floor IDR 1 IDR 2 0 ...
Hür Doğan ÜNLÜ's user avatar

15 30 50 per page
1
2 3 4 5
771