Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Add new keyword: colorbar? #135

Closed
tbreloff opened this issue Feb 4, 2016 · 8 comments
Closed

RFC: Add new keyword: colorbar? #135

tbreloff opened this issue Feb 4, 2016 · 8 comments

Comments

@tbreloff
Copy link
Member

tbreloff commented Feb 4, 2016

Related to #122, it should be possible to toggle the series legend separately from a colorbar. When implemented, legend will refer to the series legend, while colorbar will refer to the colorbar.

This means there's an extra step to turn both off... is this bad?

An alternative is to change the behavior of legend to accept symbols: legend = :series or legend = :colorbar... then legend = false could mean "turn both off", legend = true could mean "turn both on", and the symbols imply we would only turn one or the other on. (Could also accept :none, :both, :all, etc)

@pkofod
Copy link
Contributor

pkofod commented Feb 4, 2016

If it is all controlled through legend I would probably prefer :none, :both, :series, :colorbar.

However, the question is: which one is more intuitive? A true/false for legend and colorbar, or 4+ keywords for legend? I think the problem with controlling it all through legend is, that it might be difficult to remember if it's :none or :off or false and the same for :both/:all/:on/true

@KristofferC
Copy link
Contributor

Imho, legend + colorbar is clearer and more easy to remember.

@tbreloff
Copy link
Member Author

tbreloff commented Feb 4, 2016

it might be difficult to remember if it's :none or :off or false and the same for :both/:all/:on/true

I would employ a similar strategy as elsewhere, so that all of these options are allowed. In fact, I could still have the colorbar argument, but the end-user never needs to know about it. By the time it gets to the backend-specific code, I can just map it to booleans for legend and colorbar.

@tbreloff
Copy link
Member Author

tbreloff commented Feb 5, 2016

I started messing around with this, and I think it's mostly working for Gadfly and PyPlot. Here's an example:

using Plots; pyplot()
subplot(rand(10,6), t=:scatter, zcolor=1:10, nc=2,
    legend = [false true :left :top :right :left],
    colorbar = [:left false false false true :legend],
    lab="My Series Label", size=(500,700))

tmp

Right now I'm having trouble showing only the legend in Gadfly, and I'm not sure how to put them in different positions. In PyPlot I'm not sure how to change the position of the colorbar, and putting the legend outside of the plot is a royal PITA.

@tbreloff
Copy link
Member Author

tbreloff commented Feb 5, 2016

The default value for :legend is :best, which means the backend can choose. The default for :colorbar is :legend, which means it takes the value of the :legend argument. This way functionality should not change when using old code.

@pkofod
Copy link
Contributor

pkofod commented Feb 9, 2016

Right now I'm having trouble showing only the legend in Gadfly, and I'm not sure how to put them in different positions. In PyPlot I'm not sure how to change the position of the colorbar, and putting the legend outside of the plot is a royal PITA.

I've always wondered why this is not top priority of all plot software programmers. Especially the "legend outside of the plot" seems to come as a surprise to many developers.

@lobingera
Copy link

@pkofod: I belong to the group of plot software programmers, and i can assure you: Priority is always display of plot and data. Labeling, legends, colorbars gives you almost infinite options to do it wrong.

@pkofod
Copy link
Contributor

pkofod commented Feb 10, 2016

@lobingera Yes, why would you worry about labelling a plot that isn't correct? I get that. Still it seems like a quite obvious thing to include: options for re-arranging legends.

It probably depends a lot on the reason why you are making a plot. If you are using it to explore data for example, I wouldn't care too much, but if it is for a publication and external communication it is actually quite important to me how the plot looks.

However, I think we might be heading off towards the land of off-topic :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants