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: Fri, 29 Jul 2005 07:49:11 -0400

Oops... I forgot the transpose on xtics = [...]' in the example I gave you.

Without it, you get a single tic at the left.

        - Paul

On Jul 28, 2005, at 10:38 PM, Joe Koski wrote:

on 7/28/05 6:43 PM, Paul Kienzle at address@hidden wrote:

Try

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

It works for me.

- Paul
Paul, et al,

We're closer, but not there yet. When I try

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'));
tic_array = [0:2000:20000];
tics('x',tic_array,int2str(tic_array));
axis([0,20000],'tic');
grid on;
plot(w,Pxt);

gnuplot/aquaterm tries, but the x axis values are offset to the left (see attachment), and no tics or grid appear. The posibilities are 1) I'm doing something stupid, 2) there's a bug (could be mine), or 3) there's a better way. Any ideas? I've tried moving the last axis statement around with and
without the 'tic' to no avail.

This isn't urgent, but what I'm trying to do is place an x scale so that
it's easier to pick the frequencies at which the peaks occur. The
axis('auto') scale is 5000, and it's difficult to estimate the frequencies
associated with the peaks.

Joe


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
-------------------------------------------------------------


<Bad_spectrum.pdf>



-------------------------------------------------------------
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]