, ymax=2)
ax.step(x_vals, my_bits, color='g')
ax.grid()
ax.set_yticks((-1, 1))
plt.show()
- Original Message -
From: sebastian
Sent: 08/02/11 11:51 AM
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] How to create a square wave plot
Hi, On Tue, 0
Hi,
On Tue, 02 Aug 2011 08:43:47 +, Freedom Fighter wrote:
> Hi,
>
> what's the easiest method of creating a square wave plot?
> Let's say I have a data stream of bits that have values of "1" or
> "-1".
> The plot function wants to draw a diagonal line between those points
> but I need to
Hi,
what's the easiest method of creating a square wave plot?
Let's say I have a data stream of bits that have values of "1" or "-1".
The plot function wants to draw a diagonal line between those points but I
need to have a horizontal line. So to get a "square wave" I must insert
additional p