try:
import numpy as _numpy
+ import matplotlib as _matplotlib
from matplotlib import pyplot as _pyplot
_pyplot.ion()
FIGURE = _pyplot.figure()
axes = FIGURE.add_subplot(1, 1, 1)
axes.plot(data['z'], data['deflection'], label='Approach')
axes.set_title('Unfolding too far')
- _pyplot.show()
+ FIGURE.canvas.draw()
+ if hasattr(FIGURE, 'show'):
+ FIGURE.show()
+ if not _matplotlib.is_interactive():
+ _pyplot.show()
_LOG.debug('raising ExceptionTooFar')
raise ExceptionTooFar
return data
axes.plot(unfold['z'], unfold['deflection'], label='Unfold')
axes.legend(loc='best')
axes.set_title('Unfolding')
- _pyplot.draw()
- _pyplot.show()
+ FIGURE.canvas.draw()
+ if hasattr(FIGURE, 'show'):
+ FIGURE.show()
+ if not _matplotlib.is_interactive():
+ _pyplot.show()
def zero_piezo(self):
_LOG.info('zero piezo')