Robert Hill <[email protected]> asks,
> I'm a relatively new STATA user and am producing pcharts in Stata 9
> (using the pchart command). I can't change the format of the label
> on the centre line, at present it is labelled with seven decimal
> places and I would like just two.
The format can be changed, though one could never this from the -pchart-
documentation. Only a deep understanding of Stata graphics and how -pchart-
works will get you to the answer.
Robert can get his two-decimal-places format by using the following compound
option on his -pchart- command,
. pchart ... , ylabel(, format(%5.2f) axis(2))
How in the world did I guess that?
I saw that the reference-line label was placed on its own y-axis -- an axis
that was placed along the right of the plotregion. That meant I could use
standard axis options to modify the look of that label. In this case, I used
the -format()- option of -ylabel()- to specify a floating-point format with 2
decimal places. I also had to guess that this was the 2nd y-axis and so I
could only affect it, and not the primary y-axis, by adding the -axis(2)-
suboption to -ylabel()-.
Beyond the display format, we could use this same approach to change the size,
color, or orientation of the label. We could also have removed or changed its
tick mark, or done anything else we can do to axes and their labels.
As I said, not easily guessed.
We will look into documenting this or changing the command to make access to
this flexibility more transparent.
-- Vince
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/