Statalist


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

Re: st: Map with wrong colors


From   "Sergiy Radyakin" <[email protected]>
To   [email protected]
Subject   Re: st: Map with wrong colors
Date   Thu, 6 Sep 2007 14:30:06 +0200

I think you are mixing different coloring methods. If you want to plot
quantiles, specify clmethod(quantile) and provide your original
variable (from which quantiles should be plotted). clmethod(unique)
will assign each value a different color from the set that you
provide. I think it works as described in the helpfile. Leave missing
values missing, and use ndfcolor() option.

Best regards, Sergiy Radyakin


On 9/6/07, Friedrich Huebler <[email protected]> wrote:
> When I draw a choropleth map with -spmap- from SSC, the regions have
> the wrong colors. I define a variable called "key" with the values 1
> to 6, recoded from a variable with the range 0 to 100 percent. 1 to 5
> identify quintiles and 6 identifies regions with missing data. My
> -spmap- command is shown below, with fill colors specified with RGB
> values.
>
> #delimit ;
> spmap key using map.dta,
>  id(id)
>  clmethod(unique)
>  fcolor("215 25 28" "253 174 97" "255 255 191" "171 217 233" "44 123
> 182" "225 225 225")
> ;
>
> None of the regions have a value below 20 and none have a value
> between 60 and 80, so that the first and fourth color in the list
> above ("215 25 28" = dark red and "171 217 233" = light blue) should
> not appear on the map. However, the map is drawn with the first three
> colors from the fcolor list instead of the second, third and fifth
> color. All regions with the value 2 are filled with the color "215 25
> 28", all regions with the value 3 are filled with the color "253 174
> 97", and all regions with the value 5 are filled with the color "255
> 255 191".
>
> What am I doing wrong?
>
> Friedrich
> *
> *   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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index