Matplotlib drawstyle steps-pre


I have some matplotlib plots that are converted and uploaded to plotly (by It seems that the matplotlib drawstyle ‘steps-pre’ and ‘steps-post’ are not being converted to the plotly shape ‘hvh’ and ‘vhv’.

Does someone know how to achieve step plots in plotly, from my matplotlib figures?

Sample code:

from matplotlib import gridspec
import matplotlib.pyplot as plt
import numpy as np
import datetime as dt
import as tls
import plotly.plotly as plotpy

a = np.array([dt.datetime(2013, 1, 1), dt.datetime(2013, 1, 2), dt.datetime(2013, 1, 5), dt.datetime(2013, 1, 15), dt.datetime(2013, 1, 25)]) 
b = np.random.random_sample((5))
c = np.random.random_sample((5))

mpl_fig = plt.figure()
gs = gridspec.GridSpec(1, 1)
ax = mpl_fig.add_subplot(gs[0])

p = []
plotargs = {'drawstyle':'steps-pre','linestyle':'--', 'marker':'o','color':'r'}
p.append(ax.plot_date(a, b, **plotargs))
plotargs = {'drawstyle':'steps-post','linestyle':'-', 'marker':'+','color':'b'}
p.append(ax.plot_date(a, c, **plotargs))

plotly_fig = tls.mpl_to_plotly(mpl_fig)
plot_url = plotpy.plot(plotly_fig,filename='matplotlib step-plot',auto_open=False)