All Questions
Tagged with pandas matplotlib
11,558
questions
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=...
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&...
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 ...
-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)...
-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....
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 ...
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 ...
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 ...
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 = ...
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', '...
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 ...
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 ...
-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):
...
-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 ...
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 ...