help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plot save time scales with plot complexity


From: Przemek Klosowski
Subject: Re: plot save time scales with plot complexity
Date: Thu, 29 Mar 2012 13:43:30 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/28/2012 05:43 PM, BobM wrote:

If I make the plot more complicated, but with the same number of points
t = (1:100000)
b = sin(2*pi*t/1000)
plot(t,b)
et to save ~ 19 sec
b = sin(2*pi*t/100) time to save as png goes to ~ 50 sec.

For what it's worth, on my 2.3 GHz Linux box it takes 6 and 1.6 seconds respectively as measured by tic(),print 'test.png' -dpng,toc().

In any case, you are trying to plot 100,000 points in a space of 500 or so pixels; I would suggest trimming your data by either simple decimation:

decVec=1:100:100000;
plot(t(decVec),b(decVec))

which of course loses detail, especially for a periodic function like you had. If you are concerned, average the data over those intervals:

ts=sum(reshape(t,100,1000))/100
bs=sum(reshape(b,100,1000))/100
plot(ts,bs)

which for this data is still wrong, but understandable, and it makes sense in general case.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]