0

The matplotlib graph**strong text** should show on the x axis each country of our planet, and on the y axis the percentage of female representation on the parlament. Unfortunately, the countries on the x axis overlap and are unreadable. How can I make the x axis broader as to read the countries?

plt.scatter(
    dt04final["REG_CTRY_AREA"], 
    dt04final["Value_Seat_Proportion_held_by_women_nal_parlament"],
    marker = "^",
    color = 'b',
    alpha = 0.3,
    s = 124,
    label = ['female parlament representation']
    )

plt.xlabel('country')
plt.ylabel('female representation nal.parl.')

plt.axis([1.5, 230, 0, 90])
plt.xticks(rotation=45, ha='right')

plt.legend(loc = 'upper left')
plt.show()
Ernestico
  • 1
  • 1
  • You could set a larger figsize, e.g. `plt.figure(figsize=(20, 8))` (to be called before `plt.scatter`). – JohanC Mar 08 '22 at 22:08
  • You can also [change the font size](https://stackoverflow.com/questions/12444716/how-do-i-set-the-figure-title-and-axes-labels-font-size-in-matplotlib). – ramzeek Mar 08 '22 at 23:58
  • Big, thanks both recommendations were very useful, now I can read the graph properly! – Ernestico Mar 10 '22 at 15:42

0 Answers0