Plotting points in fainter color on an IDL plot [message #86510] |
Fri, 15 November 2013 03:08  |
Kaushal Sharma
Messages: 12 Registered: August 2013
|
Junior Member |
|
|
Hello, I have a scatter plot in which there are some points which represent more reliable determinations than others. I want to plot both kinds of points in the same color but the less reliable ones in paler colors. In a sense, I want to change the brightness of few points on the plot. Is it possible in IDL? I am using color table 13 and plot and oplot procedure of IDL.
Thanks for the help,
Kaushal
|
|
|
Re: Plotting points in fainter color on an IDL plot [message #86513 is a reply to message #86510] |
Fri, 15 November 2013 06:21   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kaushal Sharma writes:
> Hello, I have a scatter plot in which there are some points which represent more reliable determinations than others. I want to plot both kinds of points in the same color but the less reliable ones in paler colors. In a sense, I want to change the brightness of few points on the plot. Is it possible in IDL? I am using color table 13 and plot and oplot procedure of IDL.
The general idea is to convert your RGB colors to HSL, modify the
lightness or saturation, then convert back to RGB, which is what IDL
requires. It looks like this:
cgLoadCT, 13
cIndex
TVLCT, r, g, b, GET=1
cgDisplay, 800, 400
cgPlot, cgDemoData(17), Color=255B, Layout=[2,1,1]
Color_Convert, r, g, b, hue, light, sat, /RGB_HLS
;light = light*0.5 ; Or whatever amount you need.
sat = sat*0.5 ; Or whatever amount you need.
Color_Convert, hue, light, sat, r, g, b, /HLS_RGB
TVLCT, r, g, b
cIndex
cgPlot, cgDemoData(17), Color=255B, Layout=[2,1,2]
END
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Plotting points in fainter color on an IDL plot [message #87285 is a reply to message #86510] |
Wed, 22 January 2014 23:27  |
Kaushal Sharma
Messages: 12 Registered: August 2013
|
Junior Member |
|
|
On Friday, November 15, 2013 4:38:38 PM UTC+5:30, Kaushal Sharma wrote:
> Hello, I have a scatter plot in which there are some points which represent more reliable determinations than others. I want to plot both kinds of points in the same color but the less reliable ones in paler colors. In a sense, I want to change the brightness of few points on the plot. Is it possible in IDL? I am using color table 13 and plot and oplot procedure of IDL.
>
>
>
>
>
> Thanks for the help,
>
> Kaushal
Thank you very much David. Your suggested solution worked for me.
Thank you once again.
|
|
|