Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Questions about -triplot-


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Questions about -triplot-
Date   Tue, 10 Feb 2009 20:15:46 -0000

Thanks to Friedrich for his continued interest in -triplot-. Answers
embedded below. 

Nick 
[email protected] 

Friedrich Huebler (FH) 

FH>>> Many thanks for the new version of -triplot-.

Is it possible to control the order of legend entries when -triplot-
is used with the separate() option? The option legend(order()) does
not have the desired effect.

NJC >>> Yes. Friedrich does not show exactly what he typed, but contrary
to the impression he has -legend(order())- can be used to this end. 

If you have no labels on the axes, the separated variables are #3 up. 
More usually, if you have labels on the axes, the separated variables
are #6 up. 

Thus, suppose that you have a variable that defines two groups, you have
labels on the axes and you wish to reverse the order of those groups in
the legend. The option call will be 

legend(order(7 6))

This isn't documented, but it can be inferred from the code. I'll
document it. It might seem better design to have what is shown
explicitly as variables #1 up, but it wouldn't be. You wouldn't want the
grid being plotted on top of the data points, for example. 
 
FH >>> Is there any way to control the appearance of text in ltext(),
rtext() and btext()? Can text be split into two lines or can it be
placed at a different angle? With the option ltext("First line" "Second
line") the quotes are ignored. With the option ltext("Label", angle(45))
the text
"Label , angle(45)" appears on the left side of the triangle.

NJC >>>  Yes and no. 

As explained in the help, these *text() options are implemented using
marker label options. They are not standard *title() options and indeed
could not be, as they are not associated with standard x or y axes. 

This bites, in so far as marker label options will not put text on two
or more lines, to the best of my knowledge. Programmers should note that
changing the syntax declaration of each option from "str" to "str asis"
will not fix this. The limitation is with the official Stata commands --
and the general design of -triplot-, which subverts -twoway- to the
extent that I know how.

The syntax of each *text() option is simply that it accepts a text
argument. Anything you specify in the hope that it will be interpreted
as suboptions will just be treated as part of the text. The separate
-text()- option is provided to tune the display by specifying marker
label options. 

Indeed, the very names -ltext()- etc. were chosen to reduce the
likelihood that these options would be misinterpreted as *title()
options. 

Thus you could specify -text(mlabangle(60))- but that would change the
angle for all the axis text options, unlikely to be what you want.
Alternatively, you could specify -text(mlabsize(*.8))- which would
change the sizes, which may well be what you want. 

The trade-off here is that changing the syntax so that each *text()
option supports separate suboptions would complicate the code
considerably for small gain. -triplot- was written in the first instance
for my own use, and so it supports the design I found convenient to
write and to use. 

Further, although it was written for Stata 9, I am mindful that those
who keep up-to-date have access to the Graph Editor for minor tweaks. 

As mentioned, I'll edit the help further. 



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index