← Back to team overview

yade-users team mailing list archive

Re: [Question #706106]: Load the data to plot

 

Question #706106 on Yade changed:
https://answers.launchpad.net/yade/+question/706106

    Status: Needs information => Answered

Karol Brzezinski proposed the following answer:
Hi Przemek,

MVE always makes it easier for everyone[1].

Do you mean something like this?

##### MVE
from yade import plot
import matplotlib.pyplot as plt

s =sphere((0,0,0),0.001)
O.bodies.append(s)
s.state.vel = (0,0,1)

O.engines += [PyRunner(command = "plot.addData(t = O.time, z =
s.state.displ()[2])", virtPeriod = 10)]

O.dt = 1e-8

plot.plots = {'t':'z'}
plot.plot()

### adding own data
ax = plt.gcf().gca()# get current 'plot' by using standard Python library
ax.plot((10,20,30,40,50,60,70),(s10,20,30,40,50,60,70),'o', linewidth = 3)# add own data

O.run(int(1e7))
########

Cheers,
Karol


[1] https://www.yade-dem.org/wiki/Howtoask

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.