How to reverse the direction of an axis in the plot?

Asked by Hashir Ahmad

Considering the plot of PIDController.py (trunk/examples/PIDController.py),

o.engines = [
    '''Other Engines'''
    PyRunner(command='addPlotData()',iterPeriod=1000,label='graph'),
]

def addPlotData():
    fMove = Vector3(0,0,0)
    for i in bodyID:
        fMove += O.forces.f(i)
    plot.addData(z=O.iter, pMove=fMove[2], pFest[2])

plot.plots={'z':('pMove','pFest')}
plot.plot()

I want to reverse the direction of pMove, pFest axis. How to do that?

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
Bruno Chareyre (bruno-chareyre) said :
#1

Hello,
yade.plot is just a simple interface between yade and matplotlib and I'm not sure it will let you revert an axis easily.
Well... I think I see a way how to do it but I wouldn't even test it (overwriting the content of plot.data after each call to plot.addData). For more advanced plottings you advise to simply use matplotlib directly.
Bruno

Can you help with this problem?

Provide an answer of your own, or ask Hashir Ahmad for more information if necessary.

To post a message you must log in.