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

Home » Public Forums » archive » formatting y-axis when plotting relative frequency using cgHistoplot
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: formatting y-axis when plotting relative frequency using cgHistoplot [message #91232 is a reply to message #91230] Thu, 18 June 2015 13:53 Go to previous messageGo to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Thursday, 18 June 2015 22:23:05 UTC+2, Steve Super wrote:
> I'm trying to determine if there is a simple way to control the y-axis labels when using the relative frequency keyword with cgHistoplot.
>
> I know IDL format codes can be used with the ytickformat keyword, however what I am hoping to do is display the relative frequency as a percentage instead of in decimal form. (e.g. 1.5% versus 0.015)
>
> The simplest option would be a keyword to set the y axis to be in %, however it doesn't appear that's possible.

You can do that with YTICKFORMAT.

plot, dindgen(100), ytickformat='(I0, "%")'

(or something very similar with cgHistoPlot, since I assume it supports the same keywords as PLOT.)

Does anyone know if there a way to output the label values used to an array? That way they can be converted to a percentage and then be explicitly set using the yticknames keyword?

plot, dindgen(100), ytick_get=yvalues

But you don't need to do that, see above.

--
Yngvar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: cgWindow - what am I doing wrong that makes winID change values?
Next Topic: size(/dimen) that automatically fills in extra dimensions

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

Current Time: Wed Oct 08 13:59:30 PDT 2025

Total time taken to generate the page: 0.00352 seconds