Closed arthurmloureiro closed 8 months ago
Ah yeah, legends are fun. I had my own bevy of issues getting them working as I wanted, and so this is actually done manually in the generic plot
function.
Specifically, you may be interested in get_artists_from_chains
, wherein the code used is effectively:
artists = get_artists_from_chains(base.chains)
leg = ax.legend(handles=artists, **legend_kwargs)
If you dont have the data put into the Chains
objects though, this may not be as simple a process as youd like though. But give that function a look over, let me know if it helps / you can use it, or if its not useful :)
Thanks!
(Apologies, I will have to open another issue about something else...)
Hi!
I am trying to use "plot_contours" (in a case where I don't need a triangle style plot) for making different panels of parameter combinations.
However, when using 2 chains, I don't seem to be able to make the labels or the chain names to appear.
Is there a way of doing this?
Here's an example code:
Including the
label='Name 1'
in theplot_contour
seems to break so the legend has no artists with labels to create the legend.