def plot(save_as=None): setup_plotting(size=(5.78, 2.6)) fig, ax = plt.subplots() plot_perception(ax) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): setup_plotting(size='fraction') fig, ax = plt.subplots() plot_errors(ax) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): # Make a square figure taking 75% of the width. width = TEXT_WIDTH * 0.75 setup_plotting(size=(width, width)) fig, ax = plt.subplots() plot_correlation_matrix(fig, ax) if save_as is not None: save_fig(fig, save_as, tight=True, dpi=300) else: plt.show()
def plot(save_as=None): # Make a square figure taking 75% of the width. width = TEXT_WIDTH * 0.75 setup_plotting(size=(width, width)) fig, ax = plt.subplots() plot_coldstart(load_data(), ax, fig) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): subplots = (1, 2) width = TEXT_WIDTH height = TEXT_WIDTH / 2 setup_plotting(size=(width + 0.3, height), subplots=subplots) fig, axes = plt.subplots(*subplots) plot_starcraft(axes) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): subplots = (1, 2) width = 5.78 height = width / GOLDEN_RATIO setup_plotting(size=(width, height), subplots=subplots) fig, (ax1, ax2) = plt.subplots(*subplots, sharex=True, sharey=True) plot_results(ax1, ax2) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): subplots = (2, 1) width = TEXT_WIDTH + 0.3 height = TEXT_WIDTH / GOLDEN_RATIO + 0.3 setup_plotting(size=(width, height), subplots=subplots) fig, axes = plt.subplots(*subplots) plot_scores(axes) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): subplots = (1, 2) width = TEXT_WIDTH height = TEXT_WIDTH * GOLDEN_RATIO setup_plotting(size=(width + 0.35, height), subplots=subplots) # setup_plotting(size='fraction') fig, axes = plt.subplots(*subplots) plot_projection(fig, axes) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): subplots = (4, 2) width = TEXT_WIDTH + 0.3 height = width * 1.3 setup_plotting(size=(width, height), subplots=subplots) fig, axes = plt.subplots(*subplots) fig.subplots_adjust(hspace=0.1) plot_predictions(fig, axes) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): subplots = (2, 1) width = TEXT_WIDTH * 0.85 height = width setup_plotting(size=(width, height), subplots=subplots) # setup_plotting(size='fraction') fig, axes = plt.subplots(*subplots) fig.subplots_adjust(hspace=0.1) plot_results(fig, axes) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()
def plot(save_as=None): subplots = (2, 2) width = TEXT_WIDTH height = 4.5 setup_plotting(size=(width, height), subplots=subplots) # Setup figure layout. gridspec = dict(wspace=0.1, bottom=0.2, right=0.95) fig, axes = plt.subplots( *subplots, sharex=False, sharey='row', gridspec_kw=gridspec, ) # Plot district and state results. plot_state(fig, axes[0, 0], axes[1, 0]) plot_district(fig, axes[0, 1], axes[1, 1]) if save_as is not None: save_fig(fig, save_as, tight=True) else: plt.show()