Last active
June 16, 2021 21:56
-
-
Save DanielTakeshi/a4a8c431bd3ab30ed578f3b579083c7a to your computer and use it in GitHub Desktop.
Revisions
-
DanielTakeshi revised this gist
Jun 16, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,4 +29,4 @@ fig.legend( plt.tight_layout() plt.subplots_adjust(bottom=0.20) figname = f'plot_testpng' plt.savefig(figname) -
DanielTakeshi created this gist
Jun 16, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.style.use('seaborn') import numpy as np nrows, ncols = 1, 2 fig, ax = plt.subplots(nrows, ncols, sharey=False, squeeze=True, figsize=(9*ncols, 6*nrows)) x = np.arange(100) y0 = x + np.random.normal(loc=0.0, scale=10.0, size=100) y1 = x + np.random.normal(loc=0.0, scale=10.0, size=100) y2 = x + np.random.normal(loc=0.0, scale=5.0, size=100) ax[0].plot(x, y2, ls='-', lw=4 ,color='blue') l1, = ax[0].plot(x, y0, ls='-', lw=4 ,color='red') l2, = ax[1].plot(x, y1, ls='-', lw=4, color='blue') # Note: not sure why we need the comma here ... fig.legend( handles=[l1, l2], labels=['Red Data', 'Blue Data'], loc='lower left', prop={'size': 30}, bbox_to_anchor=(0.30, 0.0), ncol=2, shadow=True, frameon=True, ) plt.tight_layout() plt.subplots_adjust(bottom=0.20) figname = f'plot_testpng' plt.savefig(figname)(spinningup)