markovmodel / pyemma_tutorials

How to analyze molecular dynamics data with PyEMMA
Creative Commons Attribution 4.0 International
71 stars 34 forks source link

matplotlib rendering error #180

Closed marscher closed 5 years ago

marscher commented 5 years ago

In nb08 this exception is raised during rendering the figure produced by plot_1D_histogram_trajectories. When I comment out the ax.annotate call, then the figure is rendered correctly. I assume this is triggered by a rigorous check, which has been added recently. I will report it upstream.

In the meantime we can simply downgrade matplotlib for test execution.

thempel commented 5 years ago

I guess it's plt.annotate because they changed the API. Maybe I can fix that.

marscher commented 5 years ago

On 16.11.18 10:38, Tim Hempel wrote:

I guess it's the plt.annotate because they changed the API. Maybe I can fix that.

if I omit the arrowprops it succeeds.

thempel commented 5 years ago

Bug was reported to Matplotlib (https://github.com/matplotlib/matplotlib/issues/12820), for now resolved with #181 .

photoniker commented 5 years ago

I sill get this bug, in the case of saving the figure as an image (format png, jpg, tiff). Saving it as a pdf works! The problem is the annotate function.

thempel commented 5 years ago

OK, interesting. We'll have to wait for the matplotlib developers to really fix this (it's reported, cf. post above). Good that you can save it to PDF, so I suggest you stick to this as a temporary solution (and convert to png/jpeg if necessary).

photoniker commented 5 years ago

I sill get this bug, in the case of saving the figure as an image (format png, jpg, tiff). Saving it as a pdf works! The problem is the annotate function.

Maybe this helps to find the bug. If I add to the x-position a tiny distance of 0.000000000001, than is works: axarr[0].annotate('', xy=(objectZValues[3]+0.000000000001, objectIntensities[3]), xytext=(objectZValues[3],-.05), bbox=dict(boxstyle="round", fc="w"), arrowprops = settings.arrowProps)

thempel commented 5 years ago

Yes, this is how we temporarily fixed this bug here. Are you sure you are posting to the right repository?

photoniker commented 5 years ago

@thempel oh sorry, I was redirected here.