Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Legend from overlaid graphs

From   "Allan Reese (Cefas)" <[email protected]>
To   <[email protected]>
Subject   st: Legend from overlaid graphs
Date   Fri, 15 Oct 2010 11:40:00 +0100

FYI, Trying to reproduce a graph with two combinations of variables
overlaid, it was not obvious how to construct a legend with symbols for
both.  I came up with this work round but maybe there's another
solution. (BTW this is in version 10).

scatter y2 y2 y1 x1, ms(t t oh i) mcol(orange white navy gs4) || scatter
y2  x2, ms(t) mcol(orange)  legend(order( 1 "y2-x2" 3 "y1-x1") ) 

The first plot draws the y2 points in the wrong places then rubs them
out, all to make a symbol in the legend.  Change "white" to the
background colour if different. 


This email and any attachments are intended for the named recipient only.  Its unauthorised use, distribution, disclosure, storage or copying is not permitted.  If you have received it in error, please destroy all copies and notify the sender.  In messages of a non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect those of the organisation from which it is sent.  All emails may be subject to monitoring.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index