Repeated plot.plot() fail

Bug #1813782 reported by Jérôme Duriez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
New
Wishlist
Unassigned

Bug Description

Hi there,

Since bugs report get a lot of attention these days :-) let me add another one:

#######################
from yade import plot
plot.addData(x = 1 , y = 5)
plot.plots = {'x':'y'}

plot.plot()
plot.plot()
#######################

gives error messages (pointing to py/plot.py, see [*] below) at the second plot.plot() command.

It seems you can also replace any of the 2 plot.plot() (or both) with eg plot.plot(noShow=True).savefig('test.png') and get the same behavior.

I would prefer having the possibility to ask twice for a plot in one YADE session, what do you think ?

[*] Error message with yadedaily 2018.02b-290bf6a54e~bionic or yade 2018.02b:

####################
AttributeError Traceback (most recent call last)
/usr/bin/yadedaily in <module>()
----> 1 plot.plot()

/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/plot.py in plot(noShow, subPlots)
    592 .. note:: For backwards compatibility reasons, *noShow* option will return list of figures for multiple figures but a single figure (rather than list with 1 element) if there is only 1 figure.
    593 """
--> 594 createPlots(subPlots=subPlots)
    595 global currLineRefs
    596 figs=set([l.line.axes.get_figure() for l in currLineRefs])

/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/plot.py in createPlots(subPlots, scatterSize, wider)
    370 def createPlots(subPlots=True,scatterSize=60,wider=False):
    371 global currLineRefs
--> 372 figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get all current figures
    373 for f in figs: pylab.close(f) # close those
    374 currLineRefs=[] # remove older plots (breaks live updates of windows that are still open)

AttributeError: 'Line2D' object has no attribute 'get_axes'
######################

Janek Kozicki (cosurgi)
Changed in yade:
importance: Undecided → Wishlist
Revision history for this message
Janek Kozicki (cosurgi) wrote :
Revision history for this message
Janek Kozicki (cosurgi) wrote :

In case if you don't get emails from gitlab I write here because it is fixed, see https://gitlab.com/yade-dev/trunk/issues/12

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers