Statalist


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

Re: st: spmap legend title


From   "Friedrich Huebler" <fhuebler@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: spmap legend title
Date   Fri, 6 Jul 2007 12:46:18 -0400

Thank you, Scott. In the example from the help file I obtained the
best results with wider margins.

. use "Italy-RegionsData.dta"
. spmap using "Italy-RegionsCoordinates.dta", ///
id(id) diagram(variable(relig1 relig2 relig3) ///
xcoord(xcoord) ycoord(ycoord) legenda(on)) ///
legend(region(lcolor(black) margin(1 9 1 1) fcolor(white)) ///
title("Religious orientation in Italy by region", ///
size(*0.5) bexpand justification(left)))

I would prefer an option that adjusts the legend border dynamically to
the length of the title, but at least this solution works.

Thanks again,

Friedrich

On 7/6/07, Scott Merryman <scott.merryman@gmail.com> wrote:
On 7/6/07, Friedrich Huebler <fhuebler@gmail.com> wrote:
> Maurizio,
>
> Thank you, the -bexpand- option helps but my title is so long that the
> legend border cuts through the text. You can see what I mean with the
> modified example 3b from the -spmap- help file. I made the title
> longer and added a line around the legend.
>
> . use "Italy-RegionsData.dta"
> . spmap using "Italy-RegionsCoordinates.dta", ///
> id(id) diagram(variable(relig1 relig2 relig3) ///
> xcoord(xcoord) ycoord(ycoord) legenda(on)) ///
> legend(region(lcolor(black) fcolor(white)) ///
> title("Religious orientation in Italy by region", ///
> size(*0.5) bexpand justification(left)))
>
> The legend title can be written in two lines with -title("Religious
> orientation" "in Italy by region")- and the text can be made smaller
> but I would like to keep the title in one line at the same size. Can
> the border be drawn around the entire legend, including the long
> title?

You could use the -margin()- suboption within the -region()- option:

 use "Italy-RegionsData.dta"
 spmap using "Italy-RegionsCoordinates.dta", ///
id(id) diagram(variable(relig1 relig2 relig3) ///
xcoord(xcoord) ycoord(ycoord) legenda(on)) ///
legend(region(lcolor(black) margin(0 4.8 0 0) fcolor(white)) ///
title("Religious orientation in Italy by region", ///
size(*0.5) bexpand justification(left)))


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