help-octave
[Top][All Lists]
Advanced

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

Re: Setting Tic Marks


From: Paul Kienzle
Subject: Re: Setting Tic Marks
Date: Thu, 28 Jul 2005 20:43:01 -0400

Try

        xtics = [0,1000,2000,4000,8000,16000,20000]
        tics('x',xtics,int2str(xtics))

It works for me.

- Paul

On Jul 28, 2005, at 7:11 PM, Joe Koski wrote:

I'm trying to manually set tic marks on a plot. According to "help tics,"
the tics function has the form:

  tics(axis,[pos1,pos2,...],['lab1';'lab2';...])

Rather than typing a long array of pos1,pos2,pos3,..., I would prefer to
define a vector, and then pass it to tics, but I can't seem to find the
correct format. What I have tried is:

figure(ifig);
clg;
legend('off');
axis('auto');
title([in_file," - Power Spectrum - Welch"]);
xlabel("Frequency, Hz");
ylabel("Signal Amplitude, dB");
Pxt=10*log10(abs(Px'));
axis([0,20000]);
tic_array = int2str([0:1000:20000])
tics(x,tic_array);
grid on;
plot(w,Pxt);

where tic_array is a character string with the correct values, but with
space, not comma, delimiters. Without the commas, I get an error message.

Is there a simple way to convert a vector into something usable by "tics?"

Thanks,

Joe






-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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