BUG: `df.plot` works differently for `freq="h"` and `freq="60min"`
This bug has not been reported and exists on the latest version of pandas.
Reproducible Examples:
if freq="h"
from pandas import *
import numpy as np
frqncy = 'h'
idx = period_range("01/01/2000", freq=frqncy, periods=4)
df = DataFrame(
np.array([0, 1, 0, 1]),
index=idx,
columns=["A"],
)
res = df.plot()
print(res.freq)
print(df)
output:
But if freq="60min"
frqncy = '60min'
idx = period_range("01/01/2000", freq=frqncy, periods=4)
df = DataFrame(
np.array([0, 1, 0, 1]),
index=idx,
columns=["A"],
)
res = df.plot()
print(res.freq)
print(df)
the result of plotting is different
Expected Behavior:
I think for both freq="h" and freq="60min" plotting should give the same result. The correct behavior should be that what is shown for freq="h".
take
take
Hi I am new to contributing, and I was wondering how you test your changes and see the visualizations when you do print(df). Right now, I am running python in the terminal, which i'm sure is not the optimal way, and I can only see
2000-01-01 00:00 0
2000-01-01 01:00 1
2000-01-01 02:00 0
2000-01-01 03:00 1
and not the graph when running print(df)
I believe the plots display automatically if you are using an interactive environment such as Jupyter notebook.
Otherwise you can import matplotlib.pyplot as plt and then run plt.show() after you have plotted the DataFrame.