Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (47.6k points)

I often plot a point on a matplotlib plot with:

x = 10 

y = 100 

plot(x, y, "k*", label="Global Optimum") 


However, this causes the legend to put a star in the legend twice, such that it looks like:

* * Global Optimum

when I really want it to look like:

* Global Optimum

How do I do this?

1 Answer

0 votes
by (106k points)

You can change the matplotlib rc parameters dynamically in every python script. To achieve this goal.

from pylab import * 

rcParams['legend.numpoints'] = 1

Related questions

0 votes
1 answer
asked Jul 2, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer
asked Jan 5, 2021 in Python by laddulakshana (16.4k points)
0 votes
1 answer

Browse Categories