Change label and title of plots created by Yade.plot module

Asked by Alexander Eulitz [Eugen]

Hi,
how can I change the label and title of a plot that was/will be created by yades plot module.

for example?
plot.plots={'step':('unTrue','torque',),'unPerso':('normFn',),'unTrue':('normFnBis',)}
plot.plot()

I don't know I can access the pylab object that yade creates by this commands, because plot.plots just returns a dictonary.

Thank you

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#1

> I don't know I can access the pylab object that yade creates by this
commands, because plot.plots just returns a dictonary. Thank you

An answer is in trunk/py/plot.py, L.595.

fig=plot.currLineRefs[0].line.get_axes().get_figure()

Another possibility is:
fig=plot.plot(noShow=1) #here fig is a matplotlib figure or a list of them
fig.show()

It will not work with noShow=0 as the figures are not returned in that
case. Maybe a small bug?

Bruno

Revision history for this message
Alexander Eulitz [Eugen] (kubeu) said :
#2

Thanks Bruno Chareyre, that solved my question.

Revision history for this message
Alexander Eulitz [Eugen] (kubeu) said :
#3

Yes I think, that this is a bug. Would be better if figures are returned always.