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

Home » Public Forums » archive » Coord_transform in axes
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: Coord_transform in axes [message #89655 is a reply to message #89640] Thu, 06 November 2014 09:52 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
This is one way to do it: You can make your plot, then change the location of the axis ticks to arbitrary locations, and change the tick labels to arbitrary values.

imdata=dist(150,50) ;make some mock data
x=dindgen(150) ;make the x coordinates
y=-1d0+2d0*dindgen(50)/49d0 ;make the y coordinates from -1 to 1
myimage=image(imdata,x,y,axis_style=1,position=[0.2,0.2,0.8, 0.8],aspect_ratio=40.) ;make the image
nyticks=11 ;number of ticks for the y axis
ygrid=-1d0+2d0*dindgen(nyticks)/(nyticks-1d0) ;make an array of y tick values
ylabels=string(asin(ygrid)*180d0/!dpi,format='(I)') ;make the labels for the y axis
myimage['axis1'].tickvalues=ygrid ;replace the tick locations
myimage['axis1'].tickname=ylabels ;replace the tick labels
myimage.ytitle='$\theta$'
naxis=axis('y',location='right',title='sin($\theta$)',tickva lues=ygrid) ;add a second axis with the sines of the angle



On Monday, November 3, 2014 10:17:03 PM UTC-2, Joe Llama wrote:
> Just to be slightly clearer,
>
> I'm basically after a y-axis that has tick marks -90, 30, 0, 30, 90 that are all roughly equally spaced - sin(theta) space rather than in theta space where it would be -90, -45, 0, 45, 90.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: reading data with numbers and strings from data file
Next Topic: Reading binary (.ply) file of varying header size

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

Current Time: Wed Oct 08 15:56:43 PDT 2025

Total time taken to generate the page: 0.00392 seconds