Skip to content

Commit

Permalink
Force a draw of matplotlib figures.
Browse files Browse the repository at this point in the history
This ensures that the figures are draw in the notebook if a loop is performed over doNds
  • Loading branch information
jenshnielsen committed Aug 10, 2017
1 parent 04f0d7f commit 57b0c52
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qcodes/utils/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def _create_plot(i, name, data, counter_two):
plot.subplots[0].set_title(title)
plot.save("{}_{:03d}.pdf".format(plot.get_default_title(),
counter_two))
plot.fig.canvas.draw()

counter_two = 0
for j, i in enumerate(inst_meas):
Expand Down Expand Up @@ -330,7 +331,7 @@ def do1d(inst_set, start, stop, num_points, delay, *inst_meas, do_plots=True):
# suptitle and title
pdfplot.fig.tight_layout(pad=3)
pdfplot.save("{}.pdf".format(plot.get_default_title()))

pdfplot.fig.canvas.draw()
if num_subplots > 1:
_save_individual_plots(data, plottables)
if CURRENT_EXPERIMENT.get('device_image'):
Expand Down Expand Up @@ -405,6 +406,7 @@ def do1dDiagonal(inst_set, inst2_set, start, stop, num_points, delay, start2, sl
if num_subplots > 1:
_save_individual_plots(data, plottables)
pdfplot.save("{}.pdf".format(plot.get_default_title()))
pdfplot.fig.canvas.draw()
if CURRENT_EXPERIMENT.get('device_image'):
save_device_image((inst_set, inst2_set))

Expand Down Expand Up @@ -481,6 +483,7 @@ def do2d(inst_set, start, stop, num_points, delay, inst_set2, start2, stop2, num
pdfplot.save("{}.pdf".format(plot.get_default_title()))
if num_subplots > 1:
_save_individual_plots(data, plottables)
pdfplot.fig.canvas.draw()
pdfplot.save("{}.pdf".format(plot.get_default_title()))
if CURRENT_EXPERIMENT.get('device_image'):
save_device_image((inst_set, inst_set2))
Expand Down

0 comments on commit 57b0c52

Please sign in to comment.