Using color table to map symbol colors in plot [message #94425] |
Thu, 18 May 2017 18:26  |
laura.hike
Messages: 87 Registered: September 2013
|
Member |
|
|
Hi,
I can't find a similar question from earlier, but feel free to point me to one instead of answering.
I am making a map and would like to overplot values at given locations. The values are at random positions, so I want to plot them as dots, not using a contour plot. (Maybe if I get desperate I'll try that.) I start with
m = map("geographic",limit = [-25,139.8,-9.9,155])
m1 = mapcontinents(/hires)
I have three sets of data, lats, lons, and some values in an array we'll call "values". I want to plot points at the locations of the lat, lon pairs with the colors based on values. So after using a loadct, I scale the values to 0-255 in "ivalues". What I want to do next is something like
p = plot(lons, lats, color = ivalues, linestyle = 'none', symbol = 'o', sym_filled = 1, /overplot)
but I get "PLOT: Invalid internal color." when I do. I can plot the data using one color value at a time, i.e.,
p1 = plot(lons[where(c eq 225)], lats[where(c eq 225)], color = 'yellow', linestyle = 'none', symbol = 'o', sym_filled = 1, /overplot)
but, even in that style, not with a numerical value corresponding to the color table, i.e., color = 255. Is there any way to do what I'm looking for? From what I can tell, all of the color properties used with "plot" (like "symbol_color" or just "color") only take the named palette of colors as shown on
https://www.harrisgeospatial.com/docs/formattingsymsandlines .html
Thanks for any assistance,
Laura
|
|
|
Re: Using color table to map symbol colors in plot [message #94426 is a reply to message #94425] |
Thu, 18 May 2017 18:34   |
siumtesfai
Messages: 62 Registered: April 2013
|
Member |
|
|
On Thursday, May 18, 2017 at 9:26:49 PM UTC-4, laura...@gmail.com wrote:
> Hi,
>
> I can't find a similar question from earlier, but feel free to point me to one instead of answering.
>
> I am making a map and would like to overplot values at given locations. The values are at random positions, so I want to plot them as dots, not using a contour plot. (Maybe if I get desperate I'll try that.) I start with
>
> m = map("geographic",limit = [-25,139.8,-9.9,155])
> m1 = mapcontinents(/hires)
>
> I have three sets of data, lats, lons, and some values in an array we'll call "values". I want to plot points at the locations of the lat, lon pairs with the colors based on values. So after using a loadct, I scale the values to 0-255 in "ivalues". What I want to do next is something like
>
> p = plot(lons, lats, color = ivalues, linestyle = 'none', symbol = 'o', sym_filled = 1, /overplot)
>
> but I get "PLOT: Invalid internal color." when I do. I can plot the data using one color value at a time, i.e.,
>
> p1 = plot(lons[where(c eq 225)], lats[where(c eq 225)], color = 'yellow', linestyle = 'none', symbol = 'o', sym_filled = 1, /overplot)
>
> but, even in that style, not with a numerical value corresponding to the color table, i.e., color = 255. Is there any way to do what I'm looking for? From what I can tell, all of the color properties used with "plot" (like "symbol_color" or just "color") only take the named palette of colors as shown on
>
> https://www.harrisgeospatial.com/docs/formattingsymsandlines .html
>
> Thanks for any assistance,
>
> Laura
I often plot using
CGPLOTS,lons,lats,PSYM=SYMCAT(16),symsize=0.5,thick=1
|
|
|
Re: Using color table to map symbol colors in plot [message #94429 is a reply to message #94425] |
Fri, 19 May 2017 02:59   |
Markus Schmassmann
Messages: 129 Registered: April 2016
|
Senior Member |
|
|
On 05/19/2017 03:26 AM, laura.hike@gmail.com wrote:
> I can't find a similar question from earlier, but feel free to point
> me to one instead of answering.
>
> I am making a map and would like to overplot values at given
> locations. The values are at random positions, so I want to plot
> them as dots, not using a contour plot. (Maybe if I get desperate
> I'll try that.) I start with
>
> m = map("geographic",limit = [-25,139.8,-9.9,155]) m1 =
> mapcontinents(/hires)
>
> I have three sets of data, lats, lons, and some values in an array
> we'll call "values". I want to plot points at the locations of the
> lat, lon pairs with the colors based on values. So after using a
> loadct, I scale the values to 0-255 in "ivalues". What I want to do
> next is something like
>
> p = plot(lons, lats, color = ivalues, linestyle = 'none', symbol =
> 'o', sym_filled = 1, /overplot)
>
> but I get "PLOT: Invalid internal color." when I do. I can plot
> the data using one color value at a time, i.e.,
>
> p1 = plot(lons[where(c eq 225)], lats[where(c eq 225)], color =
> 'yellow', linestyle = 'none', symbol = 'o', sym_filled = 1,
> /overplot)
>
> but, even in that style, not with a numerical value corresponding to
> the color table, i.e., color = 255. Is there any way to do what I'm
> looking for? From what I can tell, all of the color properties used
> with "plot" (like "symbol_color" or just "color") only take the named
> palette of colors as shown on
>
> https://www.harrisgeospatial.com/docs/formattingsymsandlines .html
try one of these:
s=scatterplot(lon,lat,symbol='o',sym_filled=1,/overplot,magn itude=ivalues,rgb_table=yourCT)
p=plot(lon,lat,linestyle = 'none', symbol='o', sym_filled = 1,$
/overplot,vert_colors=yourCT[*,ivalues])
where yourCT is the color table in format byte(3,255)
code not tested, I hope this does what you are looking for, Markus
|
|
|
Re: Using color table to map symbol colors in plot [message #94439 is a reply to message #94429] |
Mon, 22 May 2017 15:12  |
laura.hike
Messages: 87 Registered: September 2013
|
Member |
|
|
On Friday, May 19, 2017 at 2:59:51 AM UTC-7, Markus Schmassmann wrote:
> On 05/19/2017 03:26 AM, LMH wrote:
>
>> I can't find a similar question from earlier, but feel free to point
>> me to one instead of answering.
>>
>> I am making a map and would like to overplot values at given
>> locations. The values are at random positions, so I want to plot
>> them as dots, not using a contour plot. (Maybe if I get desperate
>> I'll try that.) I start with
>>
>> m = map("geographic",limit = [-25,139.8,-9.9,155]) m1 =
>> mapcontinents(/hires)
>>
>> I have three sets of data, lats, lons, and some values in an array
>> we'll call "values". I want to plot points at the locations of the
>> lat, lon pairs with the colors based on values. So after using a
>> loadct, I scale the values to 0-255 in "ivalues". What I want to do
>> next is something like
>>
>> p = plot(lons, lats, color = ivalues, linestyle = 'none', symbol =
>> 'o', sym_filled = 1, /overplot)
>>
>> but I get "PLOT: Invalid internal color." when I do. I can plot
>> the data using one color value at a time, i.e.,
>>
>> p1 = plot(lons[where(c eq 225)], lats[where(c eq 225)], color =
>> 'yellow', linestyle = 'none', symbol = 'o', sym_filled = 1,
>> /overplot)
>>
>> but, even in that style, not with a numerical value corresponding to
>> the color table, i.e., color = 255. Is there any way to do what I'm
>> looking for? From what I can tell, all of the color properties used
>> with "plot" (like "symbol_color" or just "color") only take the named
>> palette of colors as shown on
>>
>> https://www.harrisgeospatial.com/docs/formattingsymsandlines .html
> try one of these:
>
> s=scatterplot(lon,lat,symbol='o',sym_filled=1,/overplot,magn itude=ivalues,rgb_table=yourCT)
>
> p=plot(lon,lat,linestyle = 'none', symbol='o', sym_filled = 1,$
> /overplot,vert_colors=yourCT[*,ivalues])
>
> where yourCT is the color table in format byte(3,255)
>
> code not tested, I hope this does what you are looking for, Markus
Thanks, the "scatterplot" version worked great. (I didn't try the other.)
|
|
|