colour-science / colour

Colour Science for Python
https://www.colour-science.org
BSD 3-Clause "New" or "Revised" License
2.12k stars 262 forks source link

How to turn off legend in CIE Diagram? #653

Closed hminle closed 3 years ago

hminle commented 3 years ago

Hi Colour Team,

In the CIE Diagram, how should I turn off the legend? I use this function colour.plotting.plot_RGB_colourspaces_in_chromaticity_diagram_CIE1931 But I got a very long legend, so I want either turn it off or change the legend? image

Thanks

KelSolaar commented 3 years ago

Hi @hminle,

So the quick way to turn the legend off is to do that:

colour.plotting.plot_RGB_colourspaces_in_chromaticity_diagram_CIE1931(['sRGB', 'ProPhoto RGB'], legend=False)

Alternatively, and probably better in your case:

figure, axes = colour.plotting.plot_RGB_colourspaces_in_chromaticity_diagram_CIE1931(['sRGB', 'ProPhoto RGB'], standalone=False)
axes.legend().texts = ['sRGB (Adapted)', 'ProPhoto RGB']
colour.plotting.render()  # or plt.show()

Cheers,

Thomas

hminle commented 3 years ago

Thank you a lot @KelSolaar