Plotting weridness with ytickname [message #8388] |
Fri, 28 February 1997 00:00  |
D.Kennedy
Messages: 26 Registered: January 1997
|
Junior Member |
|
|
Hi, I have this (simple) code to produce a stacked plot of
some spectra:
; Read in spectra and 'stack' them by adding an offset constant
; to the yaxis vector.
[snip]
; Set up the parameters for the plot command
xrange = [-130, 130] ; Set by hand
yrange = [-43, 20] ; Set by hand
tick_values = [-40, -30, -20, -10, 0, 10, 20]
tick_labels = [0, 10, 0, 10, 0, 10, 20]
; Plot empty frame with fiddled yaxis labelling etc
plot, xrange, yrange, xstyle=1, ystyle=1, $
ytickv=tick_values, ytickname=tick_labels, $
/nodata
; Overplot the various spectra
[snip]
Question - why is that when I run this code for the first time it produces
a yaxis which is still labelled from -42 to 20? Running the same
thing again will produce the correct labelling [0,10,0,10,0,10,20]
though. WHY?
This is bad as I rerun the program with a parameter which produces
nice eps files to go into a scientific paper. And they're labelled
wrongly... I can't just plot twice in the eps case.
This is extremely puzzling to me, I have been changing the order of
params, been fiddling with ystyle etc but can't 'fix' this. Anyone
got any ideas?
[Please email and post responses - useless newserver!]
--
David Kennedy, Dept. of Pure & Applied Physics, Queen's University of Belfast
Email: D.Kennedy@Queens-Belfast.ac.uk | URL: http://star.pst.qub.ac.uk/~dcjk/
Hi! I'm a .signature virus! Copy me into yours and join the fun!
|
|
|
Re: Plotting weridness with ytickname [message #8410 is a reply to message #8388] |
Fri, 07 March 1997 00:00  |
D.Kennedy
Messages: 26 Registered: January 1997
|
Junior Member |
|
|
In article <331699C8.ABD@osf1.mpae.gwdg.de>,
Kevin Ivory <kivory2@osf1.mpae.gwdg.de> writes:
> David Kennedy wrote:
>
>> Hi, I have this (simple) code to produce a stacked plot of
>> some spectra:
>> ; Set up the parameters for the plot command
>> xrange = [-130, 130] ; Set by hand
>> yrange = [-43, 20] ; Set by hand
>> tick_values = [-40, -30, -20, -10, 0, 10, 20]
>> tick_labels = [0, 10, 0, 10, 0, 10, 20]
>>
>> ; Plot empty frame with fiddled yaxis labelling etc
>> plot, xrange, yrange, xstyle=1, ystyle=1, $
>> ytickv=tick_values, ytickname=tick_labels, $
>> /nodata
>>
>> Question - why is that when I run this code for the first time it produces
>> a yaxis which is still labelled from -42 to 20? Running the same
>> thing again will produce the correct labelling [0,10,0,10,0,10,20]
>> though. WHY?
>
> You might be using the buggy 4.0 IDL version: I opened a new IDL
> session, pasted your code into it and got exactly what you
> expected. I use IDL Version 4.0.1 (OSF alpha).
>
> From the 4.0 -> 4.0.1 bug-fix list:
> PLOT: XTICKNAME keyword does not work correctly in some instances.
Yep, this is indeed my problem, luckily its simple to fix, simply
slap '' around each argument to xtickname. Thanks.
--
David Kennedy, Dept. of Pure & Applied Physics, Queen's University of Belfast
Email: D.Kennedy@Queens-Belfast.ac.uk | URL: http://star.pst.qub.ac.uk/~dcjk/
Hi! I'm a .signature virus! Copy me into yours and join the fun!
|
|
|