Matplotlib/Seaborn/Visualization | Basics | Priority Flashcards
Scatterplot matrix.
Machine Learning with PyTorch and Scikit-Learn Chapter 9 p274
import matplotlib.pyplot as plt from mlxtend.plotting import scatterplotmatrix scatterplotmatrix(df.values, figsize=(12, 10), names=df.columns, alpha=0.5) plt.tight_layout() plt.show()
Machine Learning with PyTorch and Scikit-Learn Chapter 9 p274
Heatmap.
Machine Learning with PyTorch and Scikit-Learn Chapter 9 p277
from mlxtend.plotting import heatmap cm = np.corrcoef(df.values.T) hm = heatmap(cm, row_names=df.columns, column_names=df.columns) plt.tight_layout() plt.show()
Machine Learning with PyTorch and Scikit-Learn Chapter 9 p277
Plot on a log scale.
Machine Learning with PyTorch and Scikit-Learn Chapter 3 p75
plt.xscale(‘log’)
Plot a legend, choosing location automatically.
plt.legend(loc=’best’)
Function: Adjust the padding between and around subplots.
Machine Learning with PyTorch and Scikit-Learn Chapter 3 p61
plt.tight_layout()
Function: Configure the grid lines.
Machine Learning with PyTorch and Scikit-Learn Chapter 3 p61
ax.yaxis.grid(True)
Function: Get the current Axes.
Machine Learning with PyTorch and Scikit-Learn Chapter 3 p61
ax = plt.gca()
Function: Add a vertical line across the Axes.
Machine Learning with PyTorch and Scikit-Learn Chapter 3 p61
import matplotlib.pyplot as plt; plt.axvline(0.0, color=’k’)