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

Home » Public Forums » archive » Re: Contour Plot Issues
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: Contour Plot Issues [message #80821 is a reply to message #80819] Fri, 13 July 2012 14:11 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ecatcom1@gmail.com writes:

> Whoops! Light bulb just turned on!
> New Code:
> xrange=[xmin,xmax]
> yrange=[ymin,ymax]
>
> numLevels=size(levels)
> LoadCT, 33, NColorS=numLevels(1), Bottom=1
> xran=xmax-xmin
> yran=ymax-ymin
> asp=yran/xran
> cgContour,aa,x(ix),y(iy), /Fill,$
> levels=levels, C_colors=Indgen(numLevels(1))+1,$
> c_labels=levels, /Outline,$
> xminor=5, yminor=5,$
> xrange=xrange, yrange=yrange,$
> xtickinterval=10, ytickinterval=10,$
> ASPECT=asp,/Window
>
> When I am resizing my window, it keeps the aspect radio the same. Yay!
> The problem is my plot doesnt show the correct aspect ratio. For example, I just plotted something with x=[-12,11] y=[-34,33], asp=2.91304 (i put a stop in my code and checked to see that all these values are correct and they are). But when it actually plots, the y-axis looks almost 5 times bigger than the x...which is not what I told it to do.
> Any ideas why this could be happening? Is my code funky?
>
> Thanks for putting up with my sillyness!

I don't know. This looks right to me. Here is the code
I used:

cgcontour, cgdemodata(2), xrange=[-12, 11], $
yrange=[-34,33], aspect=67./23

The distance from 0 to 10 on the X axis is the same as
the distance from 0 to 10 on the Y axis. Isn't that
what you wanted, for the distances to be in the same
units?

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fastest way to list combinations
Next Topic: Re: Array Integration

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

Current Time: Wed Oct 08 18:24:36 PDT 2025

Total time taken to generate the page: 0.00464 seconds