polar_contour with log coordinates [message #89688] |
Sat, 15 November 2014 07:03  |
Andrea[1]
Messages: 7 Registered: November 2010
|
Junior Member |
|
|
Hi, I'm using polar_contour to plot data from a simulation in spherical coordinates.
I replaced the contour command with cgcontour in polar_contour, so basically and example is
nr = 50; number of radii
nt = 50 ; number of Thetas
; Create a vector of radii:
r = FINDGEN(nr)/(nr-1)
; Create a vector of Thetas:
theta = !PI * fINDGEN(nt)/(nt-1)
; Create some data values to be contoured:
z = COS(theta*3) # (r-0.5)^2
; Create the polar contour plot:
POLAR_CONTOUR, z, theta,r, /cell_FILL, nlevels=10, /win, aspect=0.5
everything is ok, but I would like to have the radial axis in log, since I ahve different order of magnitues in the radius of the real data.
How can I do this?
|
|
|
Re: polar_contour with log coordinates [message #89702 is a reply to message #89688] |
Tue, 18 November 2014 09:58  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Andrea Negri writes:
>
> Hi, I'm using polar_contour to plot data from a simulation in spherical coordinates.
> I replaced the contour command with cgcontour in polar_contour, so basically and example is
>
> nr = 50; number of radii
> nt = 50 ; number of Thetas
> ; Create a vector of radii:
> r = FINDGEN(nr)/(nr-1)
> ; Create a vector of Thetas:
> theta = !PI * fINDGEN(nt)/(nt-1)
> ; Create some data values to be contoured:
> z = COS(theta*3) # (r-0.5)^2
> ; Create the polar contour plot:
> POLAR_CONTOUR, z, theta,r, /cell_FILL, nlevels=10, /win, aspect=0.5
>
> everything is ok, but I would like to have the radial axis in log, since I ahve different order of magnitues in the radius of the real data.
> How can I do this?
I'd make sure the variable R is greater than zero, and I would set the
YLOG keyword.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|