[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two questions about plotting with Octave
From: |
marco atzeri |
Subject: |
Re: Two questions about plotting with Octave |
Date: |
Mon, 02 Apr 2012 15:24:23 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 |
On 4/2/2012 3:00 PM, Zumsel wrote:
I'm still a newbie with octave, so may questions may be pretty basic:
1. Say I have to matrices data1 and data1, with two columns and n and m rows
respectively. Assume n< m. The first column is a time-coordinate, so
data2(1:n,1) is identical to data1(:,1). With
plot( data1(:,1) , [data1(:,2) ; data2(1:n,2) ])
I can plot the first column of data1 versus the second column of data1 and
the first n entries of the second column of data2. However I can't plot
plot( data2(:,1) , [data1(:,2) ; data2(:,2) ])
because data1(:,2) is too short. Is it somehow possible to have data1(:,2)
and data2(:,2) in the same plot, even though the first one is shorter?
you need 2 couples of data, of the same lentghs
plot( data1(:,1) , data1(:,2) , data2(:,1), data2(:,2) )
see "help plot"
2. With
loglog( data1(:,1) , data1(:,2) )
both axes are logarithmic. Is it possible to have only the second axis
logarithmic? Of course
plot( data1(:,1) , log(data1(:,2)) )
would give the correct plot, though with incorrect labeling of the second
axis.
semilogx, semilogy