Is there a way to control grid format when doing pandas.DataFrame.plot()?
Specifically i would like to show the minor gridlines for plotting a DataFrame with a x-axis which has a DateTimeIndex.
Is this possible through the DataFrame.plot()?
df = pd.DataFrame.from_csv(csv_file, parse_dates=True, sep=' ')
Matplotlib doesn't show the minor ticks / grid by default so you also need explicitly show them using minorticks_on() .
To plot a specific column, use the selection method of the subset data tutorial in combination with the plot() method. Hence, the plot() method works on both Series and DataFrame .
The size of a plot can be modified by passing required dimensions as a tuple to the figsize parameter of the plot() method. it is used to determine the size of a figure object. Where dimensions should be given in inches.
Maybe this feature didn't exist last year, but in version 0.19.2 you can do:
df.plot(grid=True)
See the doc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With