Remove automatic legend for a triplot figure

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Dournac Fabien
Posts: 43
Joined: May 18 2019
Affiliation: IRAP
Contact:

Remove automatic legend for a triplot figure

Post by Dournac Fabien » September 13 2020

Hello,

I am looking for removing the implicit legend with function g.triangle_plot :

First, I did a circumvented way to manually set the location of legend :

Code: Select all


# Call triplot
g.triangle_plot([matrix1, matrix2],
                names,
                filled = True,
                contour_colors = ['darkblue','red'],
                line_args = [{'lw':2, 'color':'darkblue'},
                {'lw':2, 'color':'red'}],
               )

g.add_legend(['Opt. Flat. No Gamma. - optimistic case - cross - standard situation - Criterion taking into accound a = 200', 'Pess. Flat. No Gamma. - pessimistic case - cross - standard situation - Criterion taking into account a = 300' ], bbox_to_anchor = [1.0, 8.5])
Unfortunately, there is another legend that appears and that displayss over the wanted legend produced by g.add_legend routine.

Here an example :

Image

How to remove explicitely this legend names 'Samples0,Samples1" ? I didn't find any options to not show it.

Regards

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

Re: Remove automatic legend for a triplot figure

Post by Antony Lewis » September 14 2020

Use the legend_labels argument passing an empty list.

Post Reply