From: Dima K. <gn...@di...> - 2020-05-01 21:23:18
|
Hi. The docs (help fillstyle) say that the default fillstyle is "empty". But this isn't what's happening: set grid set object rectangle from 0,0 to 1,1 plot [-1:2][-1:2] x Note that the grid lines do not show up behind the rectangle. If I explicitly add "fillstyle empty" to the rectangle definition, you get the transparent rectangle. Thanks! |
From: Ethan A M. <me...@uw...> - 2020-05-01 22:40:14
|
On Friday, 1 May 2020 14:04:22 PDT Dima Kogan wrote: > Hi. The docs (help fillstyle) say that the default fillstyle is "empty". > But this isn't what's happening: > > set grid > set object rectangle from 0,0 to 1,1 > plot [-1:2][-1:2] x > > Note that the grid lines do not show up behind the rectangle. If I > explicitly add "fillstyle empty" to the rectangle definition, you get > the transparent rectangle. Going way back to the initial implementation of rectangle as objects, the default was "solid fill with background color", which is not the same thing as "empty". This is true for all object types. gnuplot> help set style rectangle Rectangles defined with the `set object` command can have individual styles. However, if the object is not assigned a private style then it inherits a default that is taken from the `set style rectangle` command. [snip] The default values correspond to solid fill with the background color and a black border. The idea was to have separate global fill styles for each object type. In retrospect that might not have been the best idea, but that's what we have. In retrospect it might also have been better to have all global fill styles start with the same default. What do you think? Is it worth breaking backward compatibility to change this? I'm inclined to say yes, but only in the development verion, not for 5.4. Do away with separate fillstyles? Keep them but give them all the same default properties? There is another very messy historical artifact about fill styles that goes with this and affects many many places in the code. Example: plot FOO with candlesticks lt 3 At the time it seemed reasonable that if the fillstyle was "empty", this meant to use the color of linetype 3 for the border of the candlestick boxes. But if the fillstyle was "solid" it meant use the color of linetype 3 for the fill area, not the border. See the problem? Then it got worse when "set fillstyle" got a bordercolor property and worse again when linetype and linecolor became differentiated. This adds complexity and non-obvious side effects in a lot of places. When the code sees "plot ... with boxes lc foo", where should it store that color? As the linecolor of the plot? As the bordercolor of the fillstyle for that plot? As the fill color for the fillstyle for that plot? Right now it's a messy combination of all three options depending on whether the fillstyle is EMPTY or SOLID and depending on whether we are in pm3d or hidden3d mode. Ugh. It would be much nicer to rationalize where colors are stored, even if it means adding yet more places to the plot structure. But that would be quite a lot of work and likely to generate a trail of bug reports because it touches the code in so many places. Maybe a wishlist item for version 6? Ethan |
From: Ethan A M. <me...@uw...> - 2020-05-01 23:52:16
|
On Friday, 1 May 2020 15:38:15 PDT Ethan A Merritt wrote: > On Friday, 1 May 2020 14:04:22 PDT Dima Kogan wrote: > > Hi. The docs (help fillstyle) say that the default fillstyle is "empty". > > But this isn't what's happening: > > > > set grid > > set object rectangle from 0,0 to 1,1 > > plot [-1:2][-1:2] x > > > > Note that the grid lines do not show up behind the rectangle. If I > > explicitly add "fillstyle empty" to the rectangle definition, you get > > the transparent rectangle. > > Going way back to the initial implementation of rectangle as objects, > the default was "solid fill with background color", which is not the > same thing as "empty". This is true for all object types. > > gnuplot> help set style rectangle > Rectangles defined with the `set object` command can have individual styles. > However, if the object is not assigned a private style then it inherits a > default that is taken from the `set style rectangle` command. > [snip] > The default values correspond to solid fill with the background color and a > black border. > > The idea was to have separate global fill styles for each object type. > In retrospect that might not have been the best idea, but that's what we have. > In retrospect it might also have been better to have all global fill styles > start with the same default. > > What do you think? > Is it worth breaking backward compatibility to change this? > I'm inclined to say yes, but only in the development verion, not for 5.4. > Do away with separate fillstyles? > Keep them but give them all the same default properties? After some thought, I'm coming around to thinking that if we do change it, 5.4 would be a good time. It could be a bullet point in the Release Notes o CHANGE - objects (rectangles, circles, etc) now default to fillstyle "empty" rather than solid fill with background color. Ethanμ |
From: Dima K. <gn...@di...> - 2020-05-02 22:02:11
|
Hi. Thanks for the context. I don't entirely follow the explanation, though. You're saying that "set style fill" kicks in when objects come from the plot and "set style rectangle" kicks in when objects come from "set object rectangle"? My general feeling is that breaking backwards compatibility should be avoided at all costs, and we probably should leave this the way it is. After all, it has been this way, and you hear complaints very rarely. One thing we SHOULD change is the docs. The impetus for this thread was that I was apparently looking at the wrong part of the docs, which told me the wrong thing. If the interpretation above is correct, then "help set style rectangle" can say The default values correspond to solid fill with the background color and a black border. Note that this default applies to rectangles created with "set object". Rectangles from data are controlled by "set style fill", and are empty by default. Or something like that. Is that reasonable? |
From: Ethan A M. <me...@uw...> - 2020-05-03 00:20:44
|
On Saturday, 2 May 2020 15:01:57 PDT Dima Kogan wrote: > Hi. Thanks for the context. > > I don't entirely follow the explanation, though. You're saying that "set > style fill" kicks in when objects come from the plot and "set style > rectangle" kicks in when objects come from "set object rectangle"? Yes. > My general feeling is that breaking backwards compatibility should be > avoided at all costs, and we probably should leave this the way it is. > After all, it has been this way, and you hear complaints very rarely. > > One thing we SHOULD change is the docs. The impetus for this thread was > that I was apparently looking at the wrong part of the docs, which told > me the wrong thing. The information _is_ in there, but I can try to make it clearer. > If the interpretation above is correct, then "help > set style rectangle" can say > > The default values correspond to solid fill with the background color > and a black border. Note that this default applies to rectangles > created with "set object". Rectangles from data are controlled by "set > style fill", and are empty by default. > > Or something like that. Is that reasonable? It already does say something like that, doesn't it? The current text (version 5.2.8) reads Rectangles defined with the `set object` command can have individual styles. However, if the object is not assigned a private style then it inherits a default that is taken from the `set style rectangle` command. [syntax and examples snipped] The default values correspond to solid fill with the background color and a black border. The place where I can see it is a bit unclear is that "help set style fill" only says "see also 'set style rectangle'", which isn't much of a warning. I have now expanded that for 5.4 to read: Note that there is a separate default fill style for rectangle objects. See `set style rectangle`. Do you think that is OK, or is there something more or some additional place it should be expanded? Ethan |
From: Dima K. <gn...@di...> - 2020-05-04 07:58:55
|
Ethan A Merritt <me...@uw...> writes: > The place where I can see it is a bit unclear is that "help set style fill" > only says "see also 'set style rectangle'", which isn't much of a warning. > > I have now expanded that for 5.4 to read: > > Note that there is a separate default fill style for rectangle objects. > See `set style rectangle`. > > Do you think that is OK, or is there something more or some additional > place it should be expanded? Yeah, I think that's a lot better. Can we replace "rectangle objects". With "objects defined with 'set object rectangle'"? Otherwise it's not clear whether we're talking about some generic 'object' or not. Thanks much. |