Default subPlots=True prevents graphs plotting (?)

Asked by Mark S. Bentley

Hi all,

Yesterday was my first day with Yade, and so far so good - thanks for all your hard work! I am running with the "snapshots" package on ubuntu 11.04. I'm currently working through the tutorial in Yade.pdf and noticed that if I set up a single, simple plot, e.g.

plot.plots={'t':('coordNum',None,'Ek')}

and store simulation data with addData, e.g.

addData(t=O.time,Ek=utils.kineticEnergy(),coordNum=utils.avgNumInteractions())

I get a problem when trying to view with

plot.plot() or by hitting F8

In this case I get an empty matplotlib window with no content, and nothing is plotted or refreshed.

However, if I specify

plot.plot(subPlots=False)

then everything works as expected.

I just wanted to know if this was normal behaviour? It took me quite some time and head scratching to figure out what was going on. My matplotlib install is using the default TkAgg backend.

Thanks! Mark

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Janek Kozicki (cosurgi) said :
#1

Mark S. Bentley said: (by the date of Tue, 03 May 2011 14:36:44 -0000)
> plot.plot(subPlots=False)
>
> then everything works as expected.

Actually it's drawn but outside of the window. If you manipulate the
"hspace" slider (invoke it by clicking the button marked with red
circle - a I hope that attaching pictures here will work) you can move
the plots down a little, and they will become visible, but still
placed wrong.

I wonder if there's a backport of matplotlib 1.0.1 to ubuntu, because
in this version this problem disappears.

--
Janek Kozicki http://janek.kozicki.pl/ |

Revision history for this message
Anton Gladky (gladky-anton) said :
#2

I have backported matplotlib 1.0.0 for Natty in our ppa. You can do the following:

sudo add-apt-repository ppa:yade-users/external
sudo apt-get update
sudo apt-get upgrade

Revision history for this message
Yade Guide (yade-guide) said :
#3

Hey there! As an automated bot, I've gone through your question and found a few relevant threads that might interest you. Feel free to delve deeper into these topics by clicking on the links provided below.

Title: "Compiled Yade plot error in batch mode on Ubuntu 18.04"
Daniel is having trouble plotting in batch mode when compiling Yade from source code on Ubuntu 18.04 due to different matplotlib versions. He encountered 'AttributeError: 'Line2D' object has no attribute 'get_axes'. Bruno suggested trying a simple pyplot to confirm the issue, and Daniel confirmed the problem is due to the change in matplotlib versions between Ubuntu 16.04 (1.5.1) and Ubuntu 18.04 (2.1.1). He asked for instructions on how to use a simple pyplot to confirm the issue and if there's a workaround or if he needs to force install the older version of matplotlib.
https://answers.launchpad.net/yade/+question/688945

Title: "global name is not defined"
The user seeks help with understanding global and local variables in Python, specifically related to 'plot.addData' and 'plot.saveDataTxt' functions. The provided code examples demonstrate issues with accessing undefined variables and suggest avoiding modifications to global variables. Jan Stránský's solution resolved the question.
https://answers.launchpad.net/yade/+question/685061

Title: "store data"
A user got assistance with an issue in Yade version 1.07.0 involving no data being saved in the 'm.txt' file despite containing 'nan' numbers. The problem was resolved by modifying the code to not return without an empty addPlotData call when dealing with a Wall shape, and the user expressed gratitude towards Jan Stránský for the solution.
https://answers.launchpad.net/yade/+question/267162

Can you help with this problem?

Provide an answer of your own, or ask Mark S. Bentley for more information if necessary.

To post a message you must log in.