You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to highlight some data in a DataFrame using the axvspan method from matplotlib and I ran into some ill behavior. Here's a minimal example:
import numpy as np
import pandas as pd
import matplotlib.dates as mdates
from pylab import *
ion()
dates = pd.date_range(start="10/01/2013", end="10/04/2013", freq='H')
data = np.random.random_sample(len(dates))
my_df = pd.DataFrame({'r': data}, index=dates)
figure()
my_df.plot()
axvspan(*mdates.datestr2num(["10/02/2013", "10/03/2013"]),
facecolor='red', alpha=0.5)
This produces the following figure:
However, when I instead invoke the plotter via my_df.plot(x_compat=True), things are kosher:
save for the fact that the advanced x-axis formatting has been lost (easy enough to replace). I'm not sure if this is an unintended feature or a bug, but it's not documented anywhere.
The text was updated successfully, but these errors were encountered:
Hi,
I was trying to highlight some data in a DataFrame using the
axvspan
method from matplotlib and I ran into some ill behavior. Here's a minimal example:This produces the following figure:
However, when I instead invoke the plotter via
my_df.plot(x_compat=True)
, things are kosher:save for the fact that the advanced x-axis formatting has been lost (easy enough to replace). I'm not sure if this is an unintended feature or a bug, but it's not documented anywhere.
The text was updated successfully, but these errors were encountered: