Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Legend Text Color


From   smerryman@kc.rr.com
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Legend Text Color
Date   Tue, 27 Feb 2007 13:02:35 -0600

I don't believe you can selectively color parts of the legend text, 
but you could identify the colors with -text()- 

For example:
clear
set obs 25
set seed 12345
gen x1 = uniform() 
gen x2 = uniform()
gen x3 = uniform() 
gen y = uniform()
format _all %9.3g


scatter x1 x2 x3 y, ms(none ..) mlabsize(*1.2 ..) mlabcolor(red blue 
black) /// 
  mlabel(x1 x2 x3) mlabpos(0 ..)  legend(off) /// 
  xscale(range(0 1.05)) ///
  yscale(range(0 1.05)) ///
  text(1.05 1 "Label for X1", color(red)) ///
  text(1 1 "Label for X2" ,color(blue)) /// 
  text(.95 1 "Label for X3", color(black))

Scott

----- Original Message -----
From: Benjamin Allaire <btallaire@hotmail.com>
Date: Tuesday, February 27, 2007 7:40 am
Subject: st: Legend Text Color
To: statalist@hsphsun2.harvard.edu

> :01C75A11]
> Sender: owner-statalist@hsphsun2.harvard.edu
> Precedence: bulk
> Reply-To: statalist@hsphsun2.harvard.edu
> Errors-To: statalist-owner@hsphsun2.harvard.edu
> Hi all -
> Had a graphing conundrum.  I am plotting a graph where I basically 
> want the
> marker label to serve as the point on the graph.  So, I am 
> basically settin=
> g
> the marker symbol to invisible and positioning the label at the 0 
> clockposition.  This is all fine and dandy, except now the legend 
> has no symbol
> to correspond to the marker (because its invisible, right?). What 
> I would
> like to do is to change the color in the legend to correspond with 
> the labe=
> l
> - which means I would need 3 different colors for the text in the 
> legend.


*
*   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/



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