Reputation: 38177
Is there a way to reproduce the format of gnuplot's with boxes
in matplotlib? The closest so far seems to be .step
.
In Gnuplot:
import Gnuplot
gplt = Gnuplot.Gnuplot()
data = Gnuplot.Data(zip(range(3), range(3)), with_="boxes")
gplt.plot(data)
In Pyplot:
import matplotlib.pyplot as plt
plt.step(range(3), range(3))
produces (left for Gnuplot)
How can the boxes be drawn to the x-axis each time in pyplot?
Upvotes: 0
Views: 105
Reputation: 25362
You can simply create a bar chart with no space between the bars and setting fill=False
:
import matplotlib.pyplot as plt
plt.bar(range(3), range(3), fill=False, width=1)
plt.show()
Upvotes: 1