Statalist


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

Re: st: maps (or plots) and labels with different colors


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: maps (or plots) and labels with different colors
Date   Fri, 3 Apr 2009 16:04:33 -0500

Yes if you use the -by()- suboption within -label()-.  For example
using the provided example data set:


 use "Italy-RegionsData.dta", clear

 mark tag if zone == 1

 spmap relig1 using "Italy-RegionsCoordinates.dta", id(id)
label(x(xcoord) y(ycoord) label(zone) color(blue gold) by(tag) )


Scott

On Fri, Apr 3, 2009 at 1:32 PM, Vitorino, Maria Ana
<[email protected]> wrote:
>
> Dear statalist users,
>
> I would like to include labels with different colors to the same plot.
> So, suppose I plot the following map:
>
> spmap using "uscounty.dta" if state=="42", id(_ID) cln(2) ocolor(gs12 gs12)
> fcolor(white white) legend(off) label(data ("coord.dta") select(keep if
> batch <3)  color(blue) y(lati) x(longi)
> label(batch) ) title("Big Foot Sightings in Pennsylvania")
>
> (here the labels "1" and "2" will show up in blue on the map)
>
> Now suppose I would like to add the following labels to the same plot:
>
>  label(data ("coord.dta") select(keep if batch >3)  color(red) y(lati)
> x(longi)
> label(batch) )
>
> (i.e. I would like to include labels "3", "4" in red in the same plot)
>
> Is this possible? If so, how can I achieve this?
>
> Thanks,
> Ana

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