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

line labels and legends for subplots collect next to the first subplot #59

Closed
jstac opened this issue Jul 24, 2016 · 3 comments
Closed

Comments

@jstac
Copy link

jstac commented Jul 24, 2016

See, for example, the 4th figure here:

http://nbviewer.jupyter.org/github/QuantEcon/QuantEcon.applications/blob/master/discrete_dp/discrete_dp_solutions_jl.ipynb

(After the statement "We next plot the consumption policies along the value iteration. ")

If you change the backend to pyplots, then legends are correct.

@tbreloff
Copy link
Member

This is somethings that stumped me. I'd love help to figure it out.

On Sunday, July 24, 2016, John Stachurski notifications@github.com wrote:

See, for example, the 4th figure here:

http://nbviewer.jupyter.org/github/QuantEcon/QuantEcon.applications/blob/master/discrete_dp/discrete_dp_solutions_jl.ipynb

(After the statement "We next plot the consumption policies along the
value iteration. ")

If you change the backend to pyplots, then legends are correct.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#59, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AA492gbH2EHqxp8fIfW4trCnID6BE_Seks5qY13ugaJpZM4JTkYH
.

@sglyon
Copy link
Member

sglyon commented Jul 25, 2016

I believe, but could be wrong, that plotly figures have one legend per figure. This means that if we have more than one subplot in a figure, we still have only one legend.

Something I've done in a very similar situation is use the legendgroup trace attribute to either group legend entries or group AND combine them.

You can see an example of grouping and combining here: http://nbviewer.jupyter.org/gist/spencerlyon2/46e6df8ad3b84450b8cb#Unemployment-IRF-in-monthly-models

If this seems like a workable solution and you want to be able to produce figures like this let me know and I'll give the code 😄

@sglyon
Copy link
Member

sglyon commented Dec 13, 2017

This is a "feature"/behavior of plotly.js.

There is no support for multiple legends, though it has been requested on the plotly.js repo: plotly/plotly.js#1668

Will close here and if/when that gets resolved things should "just work" here too.

@sglyon sglyon closed this as completed Dec 13, 2017
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

3 participants