Statalist


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

st: Labelling the legend removes the legend count in spmap


From   Alex Olssen <Alex.Olssen@motu.org.nz>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Labelling the legend removes the legend count in spmap
Date   Tue, 22 Dec 2009 08:45:55 +1300

Hi everyone,

I'm using spmap in Stata 10.  The coloring of my map needs explanation.  As such I label the legend.  When I do this the legend count disappears - the legend count works if I run the same code without the legend label.

The code I am using is,

# delimit ;
foreach j in 402 481 589{;
    forvalues i=1/9{;
        use "$mapdata\depprcntstateprivdwe`j'", clear;
        spmap depprcntstateprivdwe`j' using "$base\mbcoord" if rc01 == `i',
        id(mbid)
        ndfcolor(gs15) ndocolor(none)
        clmethod(custom) clbreaks(-1 0 1 2 3 4 5 6 7)
        fcolor(BuRd) ocolor(none none none none none none none none none)
        legtitle("Percentage of State to Total Houses by Deprivation Index at the Meshblock Level")
        legend(label(9 "Deprived - 75% < State House Percentage") label(8 "Deprived - 50% < State House Percentage <= 75%")
        label(7 "Deprived - 25% < State House Percentage <= 50%") label(6 "Deprived - 0% < State House Percentage <= 25%")
        label(5 "Not Deprived - 75% < State House Percentage") label(4 "Not Deprived - 50% < State House Percentage <= 75%")
        label(3 "Not Deprived - 25% < State House Percentage <= 50%") label(2 "Not Deprived - 0% < State House Percentage <= 25%")
        label(1 "No State Houses") position(11)) legcount
        title("Percentage of State to Total Houses by Deprivation Index");
        qui graph export "$mapgraph\depprcntstateprivdwe_RC`i'_`j'.emf", replace;
    };
};

Any ideas as to how to get a legend count back into the map would be welcome,

Thanks,

Alex


Alex Olssen
Intern
Motu Economic & Public Policy Research
Ph 939 4250  Fax 939 4251
This email contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this email or attachments. If you have received this in error, please notify us immediately by return email, facsimile or telephone and delete this email. Thank you


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index