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

Home » Public Forums » archive » Re: save axis
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: save axis [message #72032] Wed, 04 August 2010 06:05 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Chris,
thanks for helping me out. I considered Option 1 and then dismissed it
for lack of elegance. :-) Option 2 makes sense, not as simple as I had
hoped for, but at least it works.

I still think that the plot title moving as a result of the
axs.yrange=[0,1] command is a bug. I thought we had a similar exchange
a while ago, but I am not entirely sure that this was the same issue.
It may have been on moving x/y titles instead.

Cheers,
Haje


On Aug 3, 5:55 pm, Chris Torrence <gorth...@gmail.com> wrote:
> On Aug 3, 12:35 pm, Haje Korth <hajeko...@gmail.com> wrote:
>
>> one more quirk. th efull plot code I use is
>
>>     plt=plot(loc,hist,/
>> histogram,xrange=[0,100],yrange=[0,0.2],color='black',linest yle='solid',thick=2.5,$
>>       xtitle='AC
>> Count',ytitle='N',title=region_a[i],axis_style=1,margin=[0.1 5,0.15,0.15,0.15])
>>     axs=axis('Y',location=[100,0],title='Cum.
>> Probability',color='red',tickdir=0,textpos=1)
>>     axs.yrange=[0,1]
>
>> As soon as I set the axis range, the title set in plt call moves to
>> 0.2 in the middle of the plot. grrrrr.
>
>> H
>
> Hi Haje,
>
> The new AXIS function works a bit differently than the direct graphics
> procedure. With the new graphics, the AXIS function cannot be used to
> change the plot range (i.e. there is no equivalent to the SAVE
> keyword).
>
> Instead, you have two different routes you can take.
>
> 1. You can embed the new axis in the existing plot (like you were
> doing). To make this work, you will need to force the tick names to
> match the desired range. For example:
> axs=axis('Y',location=[100,0],title='Cum. Probability', $
>   color='red',tickdir=0,textpos=1, $
>   tickvalues=[0,0.1,0.2], $
>   tickname=['0', '0.5', '1.0'])
> Obviously this gets trickier when you have a varying Y range (not just
> hardcoded to 0 - 0.2).
>
> 2. The better way is to create a new plot coordinate system. This way
> you could have a new X and Y range (if you wanted), and you could even
> plot a second line. Here is some sample code:
>
> loc = 10*findgen(11)
> hist = 0.2*randomu(seed,11)
> plt = barplot(loc,hist,bottom_values=hist, $
>   xrange=[0,100],yrange=[0,0.2], $
>   color='black',linestyle='solid',thick=2.5, $
>   xtitle='AC Count',ytitle='N',$
>   axis_style=1,margin=[0.15,0.15,0.15,0.15])
>
> ; Create a new plot coordinate system
> newDS = plot([0,100],[0,1],/current, /nodata, $
>   margin=[0.15,0.15,0.15,0.15], axis_style=0)
> axs=axis('Y',location=[100,0],title='Cum. Probability', $
>   target=newDS, $
>   color='red',tickdir=0,textpos=1)
>
> Note the /nodata in the PLOT call.
>
> Hope this helps.
>
> Cheers,
> Chris
> ITTVIS
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: color plot to file
Next Topic: Re: color plot to file

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

Current Time: Sat Oct 11 15:08:20 PDT 2025

Total time taken to generate the page: 1.03858 seconds