"No" in pandas python legend
I am using WinPython Notebook with Python 2.7. So I am reading multiple DataFrames like this:
run[y2][y3][x] = pd.read_excel(xls_file, x)
When I use:
run[y2][y3][x].plot()
I am getting a nice plot with 3 lines and a legend describing those lines as it is in the excel file at the top of the column.
However, when I draw it like this:
run[case]['fluent'][var].plot(x = 'r', y = 'inlet')
What I get in the legend is "No." Even when I use label = 'inlet'
in the .plot () part.
+3
source to share
2 answers
This was a bug in pandas and will be fixed in the upcoming 0.16.1 release (see https://github.com/pydata/pandas/pull/9574 ).
A possible workaround for now is to provide the column y
as a list:
df.plot(x='r', y=['inlet'])
+3
source to share