Menu

#1770 Key invert does not work with columnstacked histogram

None
closed-rejected
nobody
2017-02-02
2016-04-04
Anonymous
No

Using version 5.0.3 on Windows, the key invert option does not seem to do anything with columnstacked histograms

Running the following

$k << EOD
name column1 column2
a 30 40
b 20 50
EOD

set style fill solid border lt -1
set style data histogram
set key autotitle columnhead
set style histogram columnstacked

#set key invert

plot $k u 2:key(1),"" u 3

is producing the same plot with the commented line uncommented or commented. The invert option does not seem to do anything.

Pngs of the plot with the line commented and uncommented are attached.

2 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2016-04-04

    Under what circumstance would it ever make sense to have the key entry colors upside-down from the histograms themselvese? "set key invert" can make sense for scatter plots or for lines that cross each other, but never for stacked histograms that I can see, since the ordering of colors is consistent and fixed.

     
  • Matthew Halverson

    In this case, I would prefer the key entries to be in the order they are listed in the plot command instead of the reverse, even if that is different than the order in the histograms.

    If that isn't going to be supported, the documentation should be updated to reflect that. As it is, it does not say that there are cases where the option does not work in some cases:

    By default the first plot label is at the top of the key and successive labels are entered below it. The invert option causes the first label to be placed at the bottom of the key, with successive labels entered above it. This option is useful to force the vertical ordering of labels in the key to match the order of box types in a stacked histogram.

    At very least, something should be stated to note that the option is not always supported, as the documentation implies that it always works.

     
  • Ethan Merritt

    Ethan Merritt - 2016-04-05
    • status: open --> open-not-a-bug
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2017-02-02
    • status: open-not-a-bug --> closed-rejected
     

Log in to post a comment.

MongoDB Logo MongoDB