GetDist: removing legend

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Graeme Addison
Posts: 18
Joined: July 17 2014
Affiliation: Johns Hopkins University

GetDist: removing legend

Post by Graeme Addison » March 23 2017

When I make plots using g = getdist.plots.getSinglePlotter then g.plots2d I seem to automatically end up with a legend across the top of my plot if I have multiple roots. Is there a way to disable this? Including something along the lines of g.add_legend adds a second legend without removing the default one.

The examples on this page: http://cosmologist.info/cosmomc/readme_python.html don't seem to have this problem. I noticed they were made using planckStyle.getSinglePlotter. Unfortunately importing planckStyle throws up some latex-related error on the machine where my chains live, so I was wondering if there was another way.

Antony Lewis
Posts: 1352
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: GetDist: removing legend

Post by Antony Lewis » March 24 2017

Those examples are using plot_2D to built up the plot, not the automatic plots_2D.

You can also use

Code: Select allp>

g.settings.line_labels =False

Graeme Addison
Posts: 18
Joined: July 17 2014
Affiliation: Johns Hopkins University

GetDist: removing legend

Post by Graeme Addison » March 24 2017

Ah OK, hadn't appreciated the plot_2D vs plots_2D. Thanks.

Post Reply