rasbt / python-machine-learning-book-3rd-edition

The "Python Machine Learning (3rd edition)" book code repository
https://www.amazon.com/Python-Machine-Learning-scikit-learn-TensorFlow/dp/1789955750/
MIT License
4.6k stars 1.99k forks source link

Ch07: another fix for decision-region plots #77

Closed vmirly closed 4 years ago

vmirly commented 4 years ago

Original:

plt.text(-3.5, -5., 
         s='Sepal width [standardized]', 
         ha='center', va='center', fontsize=12)
plt.text(-12.5, 4.5, 
         s='Petal length [standardized]', 
         ha='center', va='center', 
         fontsize=12, rotation=90)

#plt.savefig('images/07_05', dpi=300)
plt.show()

image

Change:

plt.tight_layout()

plt.text(1, -0.2,
         s='Sepal width [standardized]',
         ha='center', va='center', fontsize=12,
         transform=axarr[1, 0].transAxes)

plt.text(-0.12, 0,
         s='Petal length [standardized]',
         ha='center', va='center',
         fontsize=12, rotation=90,
         transform=axarr[0, 0].transAxes)

image

rasbt commented 4 years ago

we decided not changing that