# -*- coding: utf-8 -*- """Plot to demonstrate the qualitative2 colormap. """ import numpy as np import matplotlib.pyplot as plt from typhon.cm import mpl_colors from typhon.plots import figsize fig, ax = plt.subplots(figsize=figsize(10)) ax.set_prop_cycle(color=mpl_colors('qualitative2', 7)) for c in np.arange(7): X = np.random.randn(100)/2 Y = np.random.randn(100)/2 ax.plot(X+c, Y+c, linestyle='none', marker='.', markersize=20) fig.tight_layout() plt.show()
# -*- coding: utf-8 -*- """Plot to demonstrate the phase colormap """ import numpy as np import matplotlib.pyplot as plt from typhon.cm import mpl_colors from typhon.plots import figsize x = np.linspace(0, 4 * np.pi, 200) phase_shifts = np.linspace(0, 2 * np.pi, 10) fig, ax = plt.subplots(figsize=figsize(10)) ax.set_prop_cycle(color=mpl_colors('phase', len(phase_shifts))) for p in phase_shifts: ax.plot(x, np.sin(x + p), lw=2) ax.set_xlim(x.min(), x.max()) ax.set_ylim(-1.2, 1.2) fig.tight_layout() plt.show()
# -*- coding: utf-8 -*- """Plot to demonstrate the qualitative1 colormap. """ import numpy as np import matplotlib.pyplot as plt from typhon.cm import mpl_colors from typhon.plots import figsize x = np.linspace(0, 10, 100) fig, ax = plt.subplots(figsize=figsize(10)) ax.set_prop_cycle(color=mpl_colors('qualitative1', 20)) for c in np.arange(20): ax.plot(x, (15 + x) * c, linewidth=3) fig.tight_layout() plt.show()