comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » axis labels
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
axis labels [message #21576] Tue, 05 September 2000 09:23 Go to next message
Mirko Vukovic is currently offline  Mirko Vukovic
Messages: 124
Registered: January 1996
Senior Member
Hi again,

I have a plot of x vs. y. I would like before hand to know
what tick-values of x IDL will put. One way is to create a dummy
plot and obtain the tick values.

Is there some more direct way? I thought IDL had a routine for that
but could not find it.

Thanks,


Mirko (Vukovic)

NB: this post is unrelated to the previous one by a fellow
of identical name.


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: axis [message #21577 is a reply to message #21576] Tue, 05 September 2000 07:38 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Martin Schultz (martin.schultz@dkrz.de) writes:
> Oh, this is a loooooong-standing "feature" of IDL (David, how
> could you forget?). Just set !y.type to 0 before the 3rd axis
> command, and you will get a linear axis.

Oh, now that you mention it....

I did try ALOG=0 first off. I had forgotten about !Y.Type=0.
Of course. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: axis [message #21578 is a reply to message #21576] Tue, 05 September 2000 07:30 Go to previous messageGo to next message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
loeh@my-deja.com wrote:
>
Oh, this is a loooooong-standing "feature" of IDL (David, how
could you forget?). Just set !y.type to 0 before the 3rd axis
command, and you will get a linear axis.

Cheers,
Martin


> Hi
>
> I have a small problem using the axis procedure.
> I don't know why my third y-axis appears as
> log-axis without setting the /ylog keyword.
> It probably comes from the /ylog keyword
> in the second y-axis.
> Is there a clean solution for this problem apart from
> switching the code for the 2nd and 3rd axis?
>
> Thank you
>
> Mirko
>
> pro aufloesung
> device,decomposed=0
> loadct,12
>
> blende=
> fwhm=
> Int=
> pzu=
>
> plot,blende,fwhm,xstyle=1,/xlog,color=0,background=255$
> ,yrange=,ystyle=9,position=,$
> ytitle='FWHM',charsize=1.1,xrange=,psym=-5,$
> xtitle='Detektorblende ' ,yticks=8,yminor=2
>
> ;======2. y-axis
> axis,yaxis=1,yrange=,/save,ystyle=1,/ylog, color=18$
> ,ytitle='Peakintensit�t ',charsize=1.1
> oplot,blende,int,color=18,psym=-4
> print, blende
>
> ;==========3. y-axis log y-axis ???

!Y.Type = 0 ;; <=============== H E R E
======================

> axis,8,yaxis=1,yrange=,/save,ystyle=1, color=180$
> ,ytitle='Peak/Untergrund ',charsize=1.1
> oplot,blende,pzu,color=180,psym=-5
>
> end
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie
[[
[[ Bundesstr. 55, 20146 Hamburg
[[
[[ phone: +49 40 41173-308
[[
[[ fax: +49 40 41173-298
[[
[[ martin.schultz@dkrz.de
[[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
Re: axis [message #21580 is a reply to message #21576] Tue, 05 September 2000 06:52 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mirko (loeh@my-deja.com) writes:

> I have a small problem using the axis procedure.
> I don't know why my third y-axis appears as
> log-axis without setting the /ylog keyword.
> It probably comes from the /ylog keyword
> in the second y-axis.
> Is there a clean solution for this problem apart from
> switching the code for the 2nd and 3rd axis?

Humm. Weird.

I don't have any idea what is happening. But I
can fix the problem by doing a plot into a pixmap
window, then going back to the drawing window.

Here is the code in my fix:

;==========3. y-axis log y-axis ???
win=!D.Window
window, /free, /pixmap, xsize=!D.X_Size, ysize=!D.Y_Size
plot,blende,pzu,xstyle=1,/xlog,color=0,background=255$
,yrange=[0.22,0.38],ystyle=9,position=[0.15,0.15,0.75,0.95], $
ytitle='FWHM',charsize=1.1,xrange=[0.03,3.0],psym=-5,$
xtitle='Detektorblende [mm]' ,yticks=8,yminor=2
wdelete, !D.Window
WSet, win

axis,8,yaxis=1,yrange=[4,14],/save,ystyle=1, color=180$
,ytitle='Peak/Untergrund ',charsize=1.1, ylog=0
oplot,blende,pzu,color=180,psym=-5

Very strange. I thought at first that it had something
to do with fields in the !P, !X, or !Y system variables.
But I saved these after the first plot and restored them
after the second plot, and it didn't do any good. This
is the best I can do. Chalk it up to the Mystery, I guess. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: axis labels [message #21659 is a reply to message #21576] Wed, 06 September 2000 11:00 Go to previous messageGo to next message
Mirko Vukovic is currently offline  Mirko Vukovic
Messages: 124
Registered: January 1996
Senior Member
In article <MPG.1420180637598672989c22@news.frii.com>,
davidf@dfanning.com (David Fanning) wrote:
> Mirko Vukovic (mvukovic@taz.telusa.com) writes:
>
>> Oh, and why do I not share the gem? Time, Time, as said Bilbo
Baggins.
>> It is currently a mess of some 50+ routines (I guess), and has still
>> rough edges. If I had two weeks off to do it, I would try to put it
on
>> a web site. But for now, it remains buried.
>
> "And documentation," Frodo said. "Don't, for the love
> of Smaug, forget the documentation!"
>
> Cheers,
>
> David
>

yep,

Gloom,

Mirko


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: axis labels [message #21660 is a reply to message #21576] Wed, 06 September 2000 09:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mirko Vukovic (mvukovic@taz.telusa.com) writes:

> Oh, and why do I not share the gem? Time, Time, as said Bilbo Baggins.
> It is currently a mess of some 50+ routines (I guess), and has still
> rough edges. If I had two weeks off to do it, I would try to put it on
> a web site. But for now, it remains buried.

"And documentation," Frodo said. "Don't, for the love
of Smaug, forget the documentation!"

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: axis labels [message #21661 is a reply to message #21576] Wed, 06 September 2000 08:31 Go to previous messageGo to next message
Mirko Vukovic is currently offline  Mirko Vukovic
Messages: 124
Registered: January 1996
Senior Member
In article <39B5DBB1.172B0CAC@fz-juelich.de>,
"r.bauer" <r.bauer@fz-juelich.de> wrote:
>
>
> Mirko Vukovic wrote:
>>
>> Hi again,
>>
>> I have a plot of x vs. y. I would like before hand to know
>> what tick-values of x IDL will put. One way is to create a dummy
>> plot and obtain the tick values.
>>
>> Is there some more direct way? I thought IDL had a routine for that
>> but could not find it.
>>
>> Thanks,
>>
>> Mirko (Vukovic)
>
> Dear Mirko,
>
> I like to hear a bit more why you like to know the axis values.
>
> Would you like to format the labels?
>
> regards
> Reimar
>
You see, I have this gorgeous piece of software. And I really mean it.
And it should be shared with the rest of the IDL world (but see later).

It is the ultimate plot routine, based on _direct_ graphics and
completely oop-ed, that can plot, replot, print, save to ps, zoom, etc.

But the gem is that it is completely _extedable_ with the user not
having to deal with its internals whatsoever (within reason). To add
another type of plot (polar say), one has to write several objects, and
modify the _caller_ to the plot routine, so that it can accept a \polar
keyword.

So, it started as me writing it for a prof. from east coast. Since then
it has evolved some, to accept polar plots, contours, (polar too), smith
charts, and now time series, where the axis is time in hours, minutes,
seconds, days, etc).

I am therefore writing the code how to display the ticks for the time
axis. I want it to be general in the sense that I plot the data:

> cplot, time, data,/time_series

where the time axis is displayed in seconds, say. But than, I may want
to modify the axis to be displayed in days (suppose my series lasts over
several days). I would then do

> modframe,xaxis='days',

and it would replot the stuff, with the axis now in days.

So, this is the origin of the question. I am working on this axis
display, and the plot will allways be vs. seconds (internally), but
then, using the axis procedure, I will put the tick marks on minutes,
days, hours, whatever I specify.

Oh, and why do I not share the gem? Time, Time, as said Bilbo Baggins.
It is currently a mess of some 50+ routines (I guess), and has still
rough edges. If I had two weeks off to do it, I would try to put it on
a web site. But for now, it remains buried.

Mirko


Sent via Deja.com http://www.deja.com/
Before you buy.
Re: axis labels [message #21672 is a reply to message #21576] Tue, 05 September 2000 22:52 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Mirko Vukovic wrote:
>
> Hi again,
>
> I have a plot of x vs. y. I would like before hand to know
> what tick-values of x IDL will put. One way is to create a dummy
> plot and obtain the tick values.
>
> Is there some more direct way? I thought IDL had a routine for that
> but could not find it.
>
> Thanks,
>
> Mirko (Vukovic)


Dear Mirko,

I like to hear a bit more why you like to know the axis values.

Would you like to format the labels?

regards
Reimar
Re: axis labels [message #21674 is a reply to message #21576] Tue, 05 September 2000 11:56 Go to previous messageGo to next message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Hello,

The plot procedure accepts the [xyz]Tick_Get keyword. I think that you
MUST plot somewhere to get the values... perhaps the Zbuffer or PixMap?

Ben

Mirko Vukovic wrote:

> Hi again,
>
> I have a plot of x vs. y. I would like before hand to know
> what tick-values of x IDL will put. One way is to create a dummy
> plot and obtain the tick values.
>
> Is there some more direct way? I thought IDL had a routine for that
> but could not find it.
>
> Thanks,
>
> Mirko (Vukovic)
>
> NB: this post is unrelated to the previous one by a fellow
> of identical name.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

--
Ben Tupper
Bigelow Laboratory for Ocean Science
West Boothbay Harbor, Maine
btupper@bigelow.org
note: email address new as of 25JULY2000
Re: Axis labels [message #21683 is a reply to message #21576] Wed, 13 September 2000 07:58 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Hello,

You might consider using David's NORMALIZE function instead of
NORM_COORD. It handles non-float values and you can specify the position
of the axis (if you don't want to scale it from 0 to 1.) If you forget
to make you range argument a floating point vector, NORM_COORD will
perfom a divide-by-integer, yielding unexpected results. Check out
www.dfanning.com.

By the way, the RECOMPUTE_DIMENSIONS keyword is one that I always set so
rescaling is automatic. I have always wished that the default was to
rescale and to prevent rescaling I had to set a keyword.

Ben



Ed Vigmond wrote:

> I am trying to label an axis but I encounter a problem that I can't
> figure out. The font on the y-axis label comes out in different aspect
> ratios depending on the y range. Sometimes the font is totally
> unreadable and the rest of the time it is just ugly. Here is the code
> and sorry if it's a simple probblem but I was following the example in
> the on-line help.
>
> graph -> SetProperty, DATAX=x, DATAY=y
> graph -> GetProperty, XRANGE=xr, YRANGE=yr
> graph -> SetProperty, XCOORD_CONV=norm_coord(xr),
> YCOORD_CONV=norm_coord(yr)
> xaxis -> SetProperty, RANGE=xr, XCOORD_CONV=norm_coord(xr)
> yaxis -> SetProperty, RANGE=yr, YCOORD_CONV=norm_coord(yr)
>
> Thanks
>
> ========================
> Dr. Edward Vigmond
> Department of Biomedical Engineering
> Tulane University

--
Ben Tupper
Bigelow Laboratory for Ocean Science
West Boothbay Harbor, Maine
btupper@bigelow.org
note: email address new as of 25JULY2000
Re: Axis labels [message #21689 is a reply to message #21576] Tue, 12 September 2000 14:19 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Ed Vigmond" <evigmon@tulane.edu> wrote in message
news:39BE83BA.B1985EBC@tulane.edu...
>
> I am trying to label an axis but I encounter a problem that I can't
> figure out. The font on the y-axis label comes out in different aspect
> ratios depending on the y range. Sometimes the font is totally
> unreadable and the rest of the time it is just ugly. Here is the code
> and sorry if it's a simple probblem but I was following the example in
> the on-line help.
>
> graph -> SetProperty, DATAX=x, DATAY=y
> graph -> GetProperty, XRANGE=xr, YRANGE=yr
> graph -> SetProperty, XCOORD_CONV=norm_coord(xr),
> YCOORD_CONV=norm_coord(yr)
> xaxis -> SetProperty, RANGE=xr, XCOORD_CONV=norm_coord(xr)
> yaxis -> SetProperty, RANGE=yr, YCOORD_CONV=norm_coord(yr)

The labels are OK when the axis is being created but they get squashed up
when it is re-scaled.

There are two ways to solve the problem:

1. Create the axes with the right scaling

xaxis = obj_new('IDLgrAxis', RANGE=xr, XCOORD_CONV=norm_coord(xr), ...)
yaxis = obj_new('IDLgrAxis', RANGE=yr, YCOORD_CONV=norm_coord(yr), ...)

2. Set the RECOMPUTE_DIMENSIONS property of all text objects associated with
the axis to 2 (look up IDL documentation for IDLgrText to see what this
means):

axis->GetProperty, TICKTEXT=oticktext, TITLE=otitle
if obj_valid(otitle) then begin
otitle->SetProperty, RECOMPUTE_DIMENSIONS=2
endif
for i=0,n_elements(oticktext)-1 do begin
if obj_valid(oticktext[i]) then begin
oticktext[i]->SetProperty, RECOMPUTE_DIMENSIONS=2
endif
endfor

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
Re: Axis labels [message #21691 is a reply to message #21576] Tue, 12 September 2000 12:41 Go to previous message
promashkin is currently offline  promashkin
Messages: 169
Registered: December 1999
Senior Member
Did you set RECOMPUTE_DIMENSIONS keyword to the axis text objects to 2?
Something like this:

x_axis -> getProperty, ticktext=x_tick_labels
x_tick_labels -> setProperty, recompute=2
x_title = obj_new('IDLgrText', 'X title', recompute=2)
x_axis -> setProperty, title=x_title, tickformat='(G0.1)'

Hope this helps.
Cheers,
Pavel

Ed Vigmond wrote:
>
> I am trying to label an axis but I encounter a problem that I can't
> figure out. The font on the y-axis label comes out in different aspect
> ratios depending on the y range. Sometimes the font is totally
> unreadable and the rest of the time it is just ugly. Here is the code
> and sorry if it's a simple probblem but I was following the example in
> the on-line help.
>
> graph -> SetProperty, DATAX=x, DATAY=y
> graph -> GetProperty, XRANGE=xr, YRANGE=yr
> graph -> SetProperty, XCOORD_CONV=norm_coord(xr),
> YCOORD_CONV=norm_coord(yr)
> xaxis -> SetProperty, RANGE=xr, XCOORD_CONV=norm_coord(xr)
> yaxis -> SetProperty, RANGE=yr, YCOORD_CONV=norm_coord(yr)
>
> Thanks
>
> ========================
> Dr. Edward Vigmond
> Department of Biomedical Engineering
> Tulane University
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: String/integer use in variable definitions
Next Topic: Re: String/integer use in variable definitions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:36:10 PDT 2025

Total time taken to generate the page: 0.00831 seconds