|
From: Patrick A. <pat...@Co...> - 2015-04-13 04:18:23
|
I am trying to use 'set palette maxcolors 5" with the "moreland.pal" palette file found at: http://www.gnuplotting.org/data/moreland.pal. Using the script: ---- set pm3d map load 'moreland.pal' set palette maxcolors 5 splot x+y ---- In gnuplot 4.6, this makes a nice discrete-color plot as intended. However in v5.0 the plot has a continuum of colors regardless of the "maxcolors" setting. In 5.0, set palette maxcolors does work for the default palette, but not moreland. Is there a reason why this is disabled for moreland palette? |
|
From: Patrick A. <pat...@Co...> - 2015-04-13 04:43:13
|
Apparently the problem is with the default terminal 'qt' in 5.0. If I change to: set term x11 then the set palette maxcolors command works again. On 04/12/2015 10:18 PM, Patrick Alken wrote: > I am trying to use 'set palette maxcolors 5" with the "moreland.pal" > palette file found at: http://www.gnuplotting.org/data/moreland.pal. > > Using the script: > ---- > set pm3d map > load 'moreland.pal' > set palette maxcolors 5 > splot x+y > ---- > > In gnuplot 4.6, this makes a nice discrete-color plot as intended. > However in v5.0 the plot has a continuum of colors regardless of the > "maxcolors" setting. > > In 5.0, set palette maxcolors does work for the default palette, but not > moreland. Is there a reason why this is disabled for moreland palette? > > ------------------------------------------------------------------------------ > BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT > Develop your own process in accordance with the BPMN 2 standard > Learn Process modeling best practices with Bonita BPM through live exercises > http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ > source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |
|
From: Ethan A M. <eam...@gm...> - 2015-04-13 05:55:56
|
On Sunday, 12 April 2015 10:18:02 PM Patrick Alken wrote: > I am trying to use 'set palette maxcolors 5" with the "moreland.pal" > palette file found at: http://www.gnuplotting.org/data/moreland.pal. > > Using the script: > ---- > set pm3d map > load 'moreland.pal' > set palette maxcolors 5 > splot x+y > ---- > > In gnuplot 4.6, this makes a nice discrete-color plot as intended. > However in v5.0 the plot has a continuum of colors regardless of the > "maxcolors" setting. There was a change in handling "maxcolors", but the change came several years ago. It is not connected to version 4 / version 5. I think the new behavior was first introduced in 4.4.3 (Mar 2011) and tweaked a bit in later versions. The change is that terminals with full RGB color support will always give you any explicitly requested color. That is, "maxcolors" will determine how many subdivisions are made for an interpolated palette, e.g. set palette defined (0 "red", 1 "blue") maxcolors 5 test palette But if you request, say, 20 explicit color ranges you will get all of them even though you said "maxcolors 5" > In 5.0, set palette maxcolors does work for the default palette, but not > moreland. Is there a reason why this is disabled for moreland palette? You provided a file containing 256 explicit colors, so that's what you got. I'm not sure why you are seeing different behavior with the x11 terminal. I wouldn't have expected that. Gnuplot version 5 does contain a new palette option that is in somewhat the same spirit as the Moreland schemes you refer to. It is obtained by "set palette cubehelix" See "help cubehelix" Full paper here: D A Green (2011) http://arxiv.org/abs/1108.5083 Ethan |
|
From: Patrick A. <pat...@Co...> - 2015-04-13 17:53:22
|
> There was a change in handling "maxcolors", but the change came several > years ago. It is not connected to version 4 / version 5. > I think the new behavior was first introduced in 4.4.3 (Mar 2011) and > tweaked a bit in later versions. > > The change is that terminals with full RGB color support will always > give you any explicitly requested color. That is, "maxcolors" will > determine how many subdivisions are made for an interpolated palette, > e.g. > set palette defined (0 "red", 1 "blue") maxcolors 5 > test palette > But if you request, say, 20 explicit color ranges you will get all > of them even though you said "maxcolors 5" I don't understand the purpose of maxcolors then. As a user I want the ability to switch between a continuous or discrete palette, and I shouldn't need to condense my 256 color palette down to 8 colors myself in order to achieve this. It seems to me that should be the purpose of the maxcolors feature. Since I manage to get my desired result in the 'x11' terminal I will continue using that. But it sounds like when I try to print to png or pdf, I may end up with a different plot. Could I request that the maxcolors be changed to automatically define discrete color levels even if more colors are provided in the palette? |
|
From: Ethan M. <eam...@gm...> - 2015-04-13 23:33:55
|
On Mon, Apr 13, 2015 at 10:53 AM, Patrick Alken
<pat...@co...> wrote:
>
>> There was a change in handling "maxcolors", but the change came several
>> years ago. It is not connected to version 4 / version 5.
>> I think the new behavior was first introduced in 4.4.3 (Mar 2011) and
>> tweaked a bit in later versions.
>>
>> The change is that terminals with full RGB color support will always
>> give you any explicitly requested color. That is, "maxcolors" will
>> determine how many subdivisions are made for an interpolated palette,
>> e.g.
>> set palette defined (0 "red", 1 "blue") maxcolors 5
>> test palette
>> But if you request, say, 20 explicit color ranges you will get all
>> of them even though you said "maxcolors 5"
>
> I don't understand the purpose of maxcolors then. As a user I want the
> ability to switch between a continuous or discrete palette
That is exactly what "maxcolors" can do.
But you didn't have a continuous palette. You had a 256-color discrete palette.
Maxcolors does not magically select 5 of your 256 colors and throw
away the rest.
Moreland gives the generating equations for the MSH color space used
to generate the palette you started with. You could either use these to
describe a continuous palette using "set palette functions" or you could
contribute a new bit of code to select the MSH colorspace as an alternative
to RGB/CMY/HSV/YIQ/etc. Either way the "maxcolors" option would then
work to sample from a continuous palette.
Here is a quick try at defining a similar (but not exact) continuous palette:
R(x) = 0.2 + 0.8 * sin(x*2.2)
B(x) = 0.2 + 0.8 * sin(0.9 + x*2.2)
G(x) = 0.3 + 0.83 * sin(x * 3.) - 0.4*x
set palette functions R(gray), G(gray), B(gray)
set palette maxcolors 5
test palette
If those continuous functions are not close enough to the Moreland palette,
you can replace them with the equations from the paper.
Ethan
> I shouldn't need to condense my 256 color palette down to 8 colors myself
> in order to achieve this. It seems to me that should be the purpose of
> the maxcolors feature.
> Since I manage to get my desired result in the 'x11' terminal I will
> continue using that. But it sounds like when I try to print to png or
> pdf, I may end up with a different plot.
>
> Could I request that the maxcolors be changed to automatically define
> discrete color levels even if more colors are provided in the palette?
|
|
From: Patrick A. <pat...@Co...> - 2015-04-14 04:10:42
|
> > Moreland gives the generating equations for the MSH color space used > to generate the palette you started with. You could either use these to > describe a continuous palette using "set palette functions" or you could > contribute a new bit of code to select the MSH colorspace as an alternative > to RGB/CMY/HSV/YIQ/etc. Either way the "maxcolors" option would then > work to sample from a continuous palette. > > Here is a quick try at defining a similar (but not exact) continuous palette: > > R(x) = 0.2 + 0.8 * sin(x*2.2) > B(x) = 0.2 + 0.8 * sin(0.9 + x*2.2) > G(x) = 0.3 + 0.83 * sin(x * 3.) - 0.4*x > set palette functions R(gray), G(gray), B(gray) > set palette maxcolors 5 > test palette > > If those continuous functions are not close enough to the Moreland palette, > you can replace them with the equations from the paper. > > Ethan > Ok, thanks for the info. It does seem that the 'x11' terminal is doing some sort of simple interpolation on the 256 points to honor the maxcolors 5 setting. This should be trivial to implement for the other terminals, but I won't push the issue any more. |