This has been asked before, and I just filed a ticket [1]. Can anyone think
of a better way to do something like this? The fill_between below is pretty
suboptimal IMO.

import matplotlib.pyplot as plt
import numpy as np

t_sec = np.arange(6)
velocity = np.array([24., 33., 40., 45., 48., 49.])

fig, ax = plt.subplots(figsize=(10,6))
lines = ax.plot(t_sec, velocity, 'mo')
ax.margins(.01)
ax.grid(False)
ax.set_ylim(0, 53);
steps = ax.step(t_sec, velocity, where='post', color='black')
filed = ax.fill_between(np.linspace(0, 5, 1001), 0,
np.r_[np.repeat(velocity[:-1], 200), 5.])

Skipper

[1] https://github.com/matplotlib/matplotlib/issues/1709
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to