formatting y-axis when plotting relative frequency using cgHistoplot [message #91230] |
Thu, 18 June 2015 13:23  |
Steve Super
Messages: 13 Registered: August 2014
|
Junior Member |
|
|
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. 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?
-Steve
|
|
|
|
Re: formatting y-axis when plotting relative frequency using cgHistoplot [message #91232 is a reply to message #91230] |
Thu, 18 June 2015 13:53   |
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
|
|
|
|