reading-notes

Software Development Reading Notes

View on GitHub

Matplotlib Seaborn and bokeh

**Matplotlib vs Seaborn**

**Simple Matplotlib example from readings**

import numpy as np # import numpy and set alias np

X = np.linspace(-np.pi, np.pi, 256, endpoint=True) # Numpy array with 256 values ranging from -pi to +pi
C, S = np.cos(X), np.sin(X) # display cosine and sine 2d figures.

**Chane colors and line widths**

# change S line color to read with line's width to 5, line style is solid.
plt.plot(X, S, color="red",  linewidth=5, linestyle="-")

**Subplot**

Plot partial data and display figures dividely.

**Axes**

Similar to subplot but allow placement of plot at any location of the figure.

**Set ticks**

Provide multiple ticks to suit data plotting.

**Moving spines**

tilt figures in the axis for better visualization

**Add legend**

plt.legend(loc='upper left', frameon=False)

**Annotate axis**

plt.annotate()

Animation

other references see this link: (credit: code fellows)

Other types of plots, quick references