From: sfeam <sf...@us...> - 2016-09-25 04:37:45
|
On Saturday, 24 September 2016 12:51:56 PM Peter Juhasz wrote: > Dear gnuplot developers, > > consider the following commands: > > set obj 1 rect from 1,1 to 2,2 fc palette frac 0.5 > plot x > > The documentation says that the fillcolor part of the set object command > accepts a generic colorspec directive, which in turn should allow a "fc > palette frac" declaration. > Given the default palette I'd expect the above commands to produce a red > rectangle on the plot, however, it comes out black. > > However, if I change the plot command to > > plot x lc palette frac 0.1 > > The rectangle suddenly gets the expected color. I also get a color bar next > to the plot. > > All of this suggests that in the first example some of the palette-related > data structures are not initialized correctly, while in the second example > they are, only because the palette is used with the function plot as well, > and that plot triggers the necessary initialization sequence. > > Peter Juhasz The program tries to figure out if a given plot requires the palette or not. It looks through the plot style and various line and text properties, but it does not look through the set of all defined objects. A work-around, if you care, is to issue the command "set pm3d implicit". I suppose the routine set_plot_with_palette() could be taught to check for object colors also, but I wonder if the better question is why should we not always initialize the palette even if no one is going to use it? Ethan |