Compiled Yade plot error in batch mode on Ubuntu 18.04

Asked by drasszkusz on 2020-02-23

Hi all!

I just compiled Yade from source code on a fresh Ubuntu 18.04. The problem is that in batch mode I have plot error and thus I can not see any plots. In not batch mode, plotting works fine. I tried it on another computer with a freshly installed Ubuntu 18.04 on it and it is the same. Am I missing something, like a not installed package? On Ubuntu 16.04 it works fine.

Thanks,
Daniel

Here are the error messages:

Traceback (most recent call last):
  File "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py", line 36, in plot
    fig=plot.plot(subPlots=True,noShow=True)
  File "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py", line 594, in plot
    createPlots(subPlots=subPlots)
  File "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py", line 372, in createPlots
    figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get all current figures
AttributeError: 'Line2D' object has no attribute 'get_axes'
Error updating plots:
Traceback (most recent call last):
  File "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py", line 36, in plot
    fig=plot.plot(subPlots=True,noShow=True)
  File "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py", line 594, in plot
    createPlots(subPlots=subPlots)
  File "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py", line 372, in createPlots
    figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get all current figures
AttributeError: 'Line2D' object has no attribute 'get_axes'

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
2020-02-24
Last query:
2020-02-24
Last reply:
2020-02-24
Chareyre (bruno-chareyre-9) said : #1

Hello, how do you expect to see plots in batch mode? I mean, it makes
little sense to pop up an arbitrary number of graphical windows, expecting
one to watch and close them while the batch proceeds. What do you really
need?
Bruno

Le dim. 23 févr. 2020 16:58, drasszkusz <
<email address hidden>> a écrit :

> New question #688945 on Yade:
> https://answers.launchpad.net/yade/+question/688945
>
> Hi all!
>
> I just compiled Yade from source code on a fresh Ubuntu 18.04. The problem
> is that in batch mode I have plot error and thus I can not see any plots.
> In not batch mode, plotting works fine. I tried it on another computer with
> a freshly installed Ubuntu 18.04 on it and it is the same. Am I missing
> something, like a not installed package? On Ubuntu 16.04 it works fine.
>
> Thanks,
> Daniel
>
> Here are the error messages:
>
> Traceback (most recent call last):
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py",
> line 36, in plot
> fig=plot.plot(subPlots=True,noShow=True)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 594, in plot
> createPlots(subPlots=subPlots)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 372, in createPlots
> figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get
> all current figures
> AttributeError: 'Line2D' object has no attribute 'get_axes'
> Error updating plots:
> Traceback (most recent call last):
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py",
> line 36, in plot
> fig=plot.plot(subPlots=True,noShow=True)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 594, in plot
> createPlots(subPlots=subPlots)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 372, in createPlots
> figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get
> all current figures
> AttributeError: 'Line2D' object has no attribute 'get_axes'
>
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
>
>

Chareyre (bruno-chareyre-9) said : #2

Oh wait, isn't it just a change in different matplotlib versions? I've seen
such things. Try with a simple pyplot to confirm it is related to yade?
Bruno

Le dim. 23 févr. 2020 16:58, drasszkusz <
<email address hidden>> a écrit :

> New question #688945 on Yade:
> https://answers.launchpad.net/yade/+question/688945
>
> Hi all!
>
> I just compiled Yade from source code on a fresh Ubuntu 18.04. The problem
> is that in batch mode I have plot error and thus I can not see any plots.
> In not batch mode, plotting works fine. I tried it on another computer with
> a freshly installed Ubuntu 18.04 on it and it is the same. Am I missing
> something, like a not installed package? On Ubuntu 16.04 it works fine.
>
> Thanks,
> Daniel
>
> Here are the error messages:
>
> Traceback (most recent call last):
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py",
> line 36, in plot
> fig=plot.plot(subPlots=True,noShow=True)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 594, in plot
> createPlots(subPlots=subPlots)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 372, in createPlots
> figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get
> all current figures
> AttributeError: 'Line2D' object has no attribute 'get_axes'
> Error updating plots:
> Traceback (most recent call last):
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py",
> line 36, in plot
> fig=plot.plot(subPlots=True,noShow=True)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 594, in plot
> createPlots(subPlots=subPlots)
> File
> "/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
> line 372, in createPlots
> figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get
> all current figures
> AttributeError: 'Line2D' object has no attribute 'get_axes'
>
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
>
>

drasszkusz (drasszkusz) said : #3

> Hello, how do you expect to see plots in batch mode? I mean, it makes little sense to pop up an arbitrary number of graphical
> windows, expecting one to watch and close them while the batch proceeds. What do you really need?

Sorry for the confusion. I meant that when I open the progress via web browser (localhost:9080) [1].

> Oh wait, isn't it just a change in different matplotlib versions? I've seen
> such things. Try with a simple pyplot to confirm it is related to yade?

On Ubuntu 16.04 the version of matplotlib is 1.5.1 and on Ubuntu 18.04 it is 2.1.1, so it is a change in versions.
Could you lend me some instructions about the confirm by simple pyplot, please?
If it is the problem because of the different versions, is there a workaround or I have to force install the older version?

Thanks,
Daniel

[1] https://yade-dem.org/doc/user.html?highlight=batch#http-overview

> Could you lend me some instructions about the confirm by simple pyplot, please?

The error says:
 "AttributeError: 'Line2D' object has no attribute 'get_axes'"

You should then make sure "get_axes" exists with matplotlib 2.1.1.

> is there a workaround or I have to force install the older version?

Well... you have to write a script compatible with the version you use.

Bruno

drasszkusz (drasszkusz) said : #5

Thanks Bruno Chareyre, that solved my question.