From: Doug H. <dh...@uc...> - 2002-02-13 00:05:31
|
Hi all: Is there any provision in PLplot for generating a color key to associate values with colors in cmap1? This would be the equivalent of the pgwedge command in PGPLOT. I am generating a web plot with points that are colored according to their value, but I need to show the users a color key. Any ideas would be appreciated! Regards, Doug Hunt -- dh...@uc... Software Engineer III, Sometimes Sysadmin UCAR - COSMIC, Tel. (303) 497-2611 |
From: Maurice L. <mj...@ga...> - 2002-02-13 00:15:58
|
Doug Hunt writes: > Hi all: Is there any provision in PLplot for generating a color key to > associate values with colors in cmap1? This would be the equivalent of > the pgwedge command in PGPLOT. A value <-> color association in PLplot is called a control point. Between these the HLS values are linearly interpolated according to position (value). So the minimum number of control points is two, at the cmap1 boundaries, but by increasing the number of control points (through the API, or you can edit a palette file and load it with the Tk interface) you can get a variety of effects. E.g. in the last release I increased the number of control points in the default map from 4 to 6 to better show off weaker features than the previous palette. The maximum number of control points is 256, which should be far more than anyone really needs. -- Maurice LeBrun mj...@ga... |
From: Doug H. <dh...@uc...> - 2002-02-13 23:24:03
Attachments:
scatterplot.mason
|
Maurice: Actually, I meant how does one draw a color key on a plot? (See the attached graphic). I can now generate this plot using my nascent PDL interface to PLplot. The trick that initially stymied me involved resetting the viewport and window on the same subpage. I also have a perl module that uses PLplot to interface to the GMT map database to draw coastlines and political boundaries. I'll release these to CPAN soon. Regards, Doug Hunt Maurice LeBrun wrote: > > Doug Hunt writes: > > Hi all: Is there any provision in PLplot for generating a color key to > > associate values with colors in cmap1? This would be the equivalent of > > the pgwedge command in PGPLOT. > > A value <-> color association in PLplot is called a control point. Between > these the HLS values are linearly interpolated according to position (value). > So the minimum number of control points is two, at the cmap1 boundaries, but > by increasing the number of control points (through the API, or you can edit a > palette file and load it with the Tk interface) you can get a variety of > effects. E.g. in the last release I increased the number of control points in > the default map from 4 to 6 to better show off weaker features than the > previous palette. The maximum number of control points is 256, which should > be far more than anyone really needs. > > -- > Maurice LeBrun mj...@ga... -- dh...@uc... Software Engineer III, Sometimes Sysadmin UCAR - COSMIC, Tel. (303) 497-2611 |
From: Alan W. I. <ir...@be...> - 2002-02-14 02:25:54
|
Nice plot, Doug! I will have to learn how to do that from Python....;-) Alan email: ir...@be... phone: 250-727-2902 FAX: 250-721-7715 snail-mail: Dr. Alan W. Irwin Department of Physics and Astronomy, University of Victoria, P.O. Box 3055, Victoria, British Columbia, Canada, V8W 3P6 __________________________ Linux-powered astrophysics __________________________ On Wed, 13 Feb 2002, Doug Hunt wrote: > Maurice: Actually, I meant how does one draw a color key on a plot? > (See the attached graphic). I can now generate this plot using my > nascent > PDL interface to PLplot. The trick that initially stymied me involved > resetting the viewport and window on the same subpage. > > I also have a perl module that uses PLplot to interface to the GMT map > database to draw coastlines and political boundaries. > > I'll release these to CPAN soon. > > Regards, > > Doug Hunt > > |
From: Maurice L. <mj...@ga...> - 2002-02-15 15:09:26
|
Doug Hunt writes: > Maurice: Actually, I meant how does one draw a color key on a plot? > (See the attached graphic). I can now generate this plot using my > nascent > PDL interface to PLplot. The trick that initially stymied me involved > resetting the viewport and window on the same subpage. I see, I didn't understand what you meant by a color key (I usually call it a "legend"), make sense now. I agree they're very useful to have, but right now its basically roll-your-own. There should probably be an API call to generate one but you'd still have to set the viewport yourself. -- Maurice LeBrun mj...@ga... |