예제 #1
0
def test_save_and_show_figure():

    fig = plt.figure()
    plt.imshow(np.random.randn(10, 10))
    plt.title('Test Figure')
    path = get_artemis_data_path('tests/test_fig.pdf')
    save_figure(fig, path=path)
    show_saved_figure(path)
예제 #2
0
def test_save_and_show_figure_3():

    fig = plt.figure()
    plt.imshow(np.random.randn(10, 10))
    plt.title('Test Figure')
    path = get_local_path('tests/test_fig.with.strangely.formatted.ending')
    path = save_figure(fig, path=path, ext='pdf')
    show_saved_figure(path)
예제 #3
0
def test_save_and_show_figure_2():

    fig = plt.figure()
    plt.imshow(np.random.randn(10, 10))
    plt.title('Test Figure')
    path = get_local_path('tests/test_fig')
    path = save_figure(fig, path=path)
    show_saved_figure(path)
예제 #4
0
 def show_figures(self, hang=False):
     """
     Show all figures that were saved during the run of the experiment.
     :param hang: If True, and figures were saved matplotlib figures, hang execution until they are closed.
     """
     from artemis.plotting.saving_plots import show_saved_figure
     for i, loc in enumerate(self.get_figure_locs()):
         show_saved_figure(loc, title='{} Fig {}'.format(self.get_id(), i + 1))
     if hang and len(self.get_figure_locs())>0:
         from matplotlib import pyplot as plt
         plt.show()
예제 #5
0
 def show_figures(self):
     from artemis.plotting.saving_plots import show_saved_figure
     for loc in self.get_figure_locs():
         show_saved_figure(loc)