OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to change legend fontsize with matplotlib.pyplot

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

Guest
Simple question here: I'm trying to get the size of my legend using matplotlib.pyplot to be smaller (i.e., the text to be smaller). The code I'm using goes something like this:

Code:
plot.figure()
plot.scatter(k, sum_cf, color='black', label='Sum of Cause Fractions')
plot.scatter(k, data[:, 0],  color='b', label='Dis 1: cf = .6, var = .2')
plot.scatter(k, data[:, 1],  color='r',  label='Dis 2: cf = .2, var = .1')
plot.scatter(k, data[:, 2],  color='g', label='Dis 3: cf = .1, var = .01')
plot.legend(loc=2)
<p>Simple question here: I'm trying to get the size of my legend using <code>matplotlib.pyplot</code> to be smaller (i.e., the text to be smaller). The code I'm using goes something like this:</p>

<pre><code>plot.figure()
plot.scatter(k, sum_cf, color='black', label='Sum of Cause Fractions')
plot.scatter(k, data[:, 0], color='b', label='Dis 1: cf = .6, var = .2')
plot.scatter(k, data[:, 1], color='r', label='Dis 2: cf = .2, var = .1')
plot.scatter(k, data[:, 2], color='g', label='Dis 3: cf = .1, var = .01')
plot.legend(loc=2)
</code></pre>
 

Latest posts

ن
Replies
0
Views
1
نعمان منذر محمود الجميلي
ن
Top