With histograms, there's a simple built-in option histtype='step'
. How do I make a bar plot in the same style?
there is no color parameter listed where you might be able to set the colors for your bar graph.
You can change the color of bars in a barplot using color argument. RGB is a way of making colors. You have to to provide an amount of red, green, blue, and the transparency value to the color argument and it returns a color.
[adding answer after reading the comments]
Set the optional keyword to be fill=False
for bar plots:
import matplotlib.pyplot as plt
plt.bar(bins[:5], counts[:5], fill=False, width=60) # <- this is the line
plt.title("Number of nodes with output at timestep")
plt.xlabel("Node count")
plt.ylabel("Timestep (s)")
will give:
Or use plt.plot
with the keyword ls='steps'
:
plt.plot(bins[-100:], counts[-100:], ls='steps')
plt.title("Number of nodes with output at timestep")
plt.xlabel("Node count")
plt.ylabel("Timestep (s)")
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