export plot figure and data
Hello,
I have 2 questions when I use plot to export data and figure. For a simple example:
from yade import pack, plot
import numpy as np
sandR1=1
sandR2=0.8
sand = FrictMat(
O.materials.
s1=utils.
s2=utils.
O.bodies.append(s1)
O.bodies.append(s2)
s2.state.
s2.state.vel = Vector3(0,0,-1e1)
Gl1_Sphere.
O.engines=[
ForceResett
InsertionSo
Interaction
),
NewtonInteg
PyRunner(
]
def addPlotData():
plot.
plot.plots=
plot.plot()
#plot.saveDataT
#plot.plot(
O.run(1000000,True)
I can correctly obtain a line on the figure.
However, when I want to export the figure like this (referring to [1]):
from yade import pack, plot
import numpy as np
sandR1=1
sandR2=0.8
sand = FrictMat(
O.materials.
s1=utils.
s2=utils.
O.bodies.append(s1)
O.bodies.append(s2)
s2.state.
s2.state.vel = Vector3(0,0,-1e1)
Gl1_Sphere.
O.engines=[
ForceResett
InsertionSo
Interaction
),
NewtonInteg
PyRunner(
]
def addPlotData():
plot.
plot.plots=
#plot.plot()
#plot.saveDataT
plot.plot(
O.run(1000000,True)
I can obtain fig1.pdf but with no line on it (just a blank figure), that is the first question.
Further, the 2nd question is when I uncomment:
plot.saveDataTx
I got an error as:
plot.saveDataTx
File "/usr/lib/
for i in range(len(
IndexError: list index out of range
Could you please point out the problem?
Thanks!
[1]https:/
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Robert Caulk
- Solved:
- Last query:
- Last reply: