Re: Plot square wave

2012-01-18 Thread Peter Otten
Yigit Turgut wrote: > Problem is I get a sawtooth instead of a square wave. I know that I > need to define points between 0,1,2 time integer values to achieve > this. But I hope there is a python trick that will yield this > time,data plot to a square wave? There is no "Python trick", pylab is sh

Plot square wave

2012-01-18 Thread Yigit Turgut
Hi all, I am trying to generate a pseudo pwm signal, low-high transition will take place when screen goes from black to white and high-low transition when white to black. As a result I am trying to plot the signal. Here is my code; import time, pylab, numpy, scipy, pygame def _func1(): glob