import prettyplotlib as ppl # Set the random seed for consistency np.random.seed(12) # Show the whole color range for i in range(8): x = np.random.normal(loc=i, size=1000) y = np.random.normal(loc=i, size=1000) ax = ppl.scatter(x, y, label=str(i)) ppl.legend(ax) ax.set_title('prettyplotlib `scatter`') %load_ext autoreload %autoreload 2 import prettyplotlib as ppl # Set the random seed for consistency np.random.seed(12) # Show the whole color range for i in range(8): y = np.random.normal(size=1000).cumsum() x = np.arange(1000) # For now, you need to specify both x and y :( # Still figuring out how to specify just one ppl.plot(x, y, label=str(i), linewidth=0.75) ppl.legend() import prettyplotlib as ppl # Set the random seed for consistency np.random.seed(12) # Show the whole color range for i in range(8): y1 = np.random.normal(size=1000).cumsum() y2 = np.random.normal(size=1000).cumsum() x = np.arange(1000) ppl.fill_between(x, y1, y2, label=str(i)) ppl.legend() import prettyplotlib as ppl # Set the random seed for consistency np.random.seed(12) # Show the whole color range for i in range(8): y1 = np.random.normal(size=1000).cumsum() y2 = np.random.normal(size=1000).cumsum() x = np.arange(1000) ppl.fill_betweenx(x, y1, y2, label=str(i)) ppl.legend() import prettyplotlib as ppl from prettyplotlib import brewer2mpl import numpy as np import string green_purple = brewer2mpl.get_map('PRGn', 'diverging', 11).mpl_colormap np.random.seed(10) fig = ppl.pcolormesh(np.random.randn(10,10), xticklabels=string.uppercase[:10], yticklabels=string.lowercase[-10:], cmap=green_purple) import prettyplotlib as ppl from prettyplotlib import brewer2mpl import numpy as np import string green_purple = brewer2mpl.get_map('PRGn', 'diverging', 11).mpl_colormap np.random.seed(10) fig = ppl.pcolormesh(np.random.randn(10,10), xticklabels=string.uppercase[:10], yticklabels=string.lowercase[-10:], cmap=green_purple, center_value=2) import prettyplotlib as ppl import matplotlib.pyplot as plt import numpy as np np.random.seed(12) # 'y' for the 'y' axis. Could also add a grid over the 'x' axis. ppl.hist(np.random.randn(1000), grid='y') import prettyplotlib as ppl import numpy as np import string np.random.seed(14) n = 10 ppl.bar(np.arange(n), np.abs(np.random.randn(n)), annotate=True, grid='y') import prettyplotlib as ppl import numpy as np import string np.random.seed(14) n = 10 ppl.barh(np.arange(n), np.abs(np.random.randn(n)), annotate=True, grid='y') import prettyplotlib as ppl import matplotlib as mpl np.random.seed(10) data = np.random.randn(8, 4) labels = ['A', 'B', 'C', 'D'] ppl.boxplot(data, xticklabels=labels)