Re: [Yade-users] [Question #690935]: makeVideo

2020-06-09 Thread Jan Stránský
Question #690935 on Yade changed:
https://answers.launchpad.net/yade/+question/690935

Jan Stránský posted a new comment:
it is some internal matplotlib error..
consider an "external" solution (e.g. gnuplot) for this purpose.
cheers
Jan

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #690935]: makeVideo

2020-06-09 Thread Launchpad Janitor
Question #690935 on Yade changed:
https://answers.launchpad.net/yade/+question/690935

Status: Open => Expired

Launchpad Janitor expired the question:
This question was expired because it remained in the 'Open' state
without activity for the last 15 days.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #690935]: makeVideo

2020-05-25 Thread Paolo
Question #690935 on Yade changed:
https://answers.launchpad.net/yade/+question/690935

Status: Answered => Open

Paolo is still having a problem:
Thank you guys, I'm making progress. I succeeded in collecting snapshots
both from the simulation and the addData graph. I eventually downloaded
mencoder and now everything works well.

Just one last thing. It happens that sometimes, during the simulation,
the following error appears and stops the evolution of the plotted
graph. The simulation goes on and I can collect the snapshots from it
correctly, but the graph remains stuck. I cannot understand what it
means.

In [1]: Unhandled exception in thread started by 
---
ValueErrorTraceback (most recent call last)
/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py in liveUpdate(timestamp)
506 for ax in axes:
507 try:
--> 508 ax.relim() # recompute axes 
limits
509 ax.autoscale_view()
510 except RuntimeError: pass # happens if 
data are being updated and have not the same dimension at the very moment

/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in relim(self, 
visible_only)
   1936 for line in self.lines:
   1937 if not visible_only or line.get_visible():
-> 1938 self._update_line_limits(line)
   1939 
   1940 for p in self.patches:

/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in 
_update_line_limits(self, line)
   1799 Figures out the data limit of the given line, updating 
self.dataLim.
   1800 """
-> 1801 path = line.get_path()
   1802 if path.vertices.size == 0:
   1803 return

/usr/lib/python2.7/dist-packages/matplotlib/lines.pyc in get_path(self)
955 """
956 if self._invalidy or self._invalidx:
--> 957 self.recache()
958 return self._path
959 

/usr/lib/python2.7/dist-packages/matplotlib/lines.pyc in recache(self, always)
665 y = self._y
666 
--> 667 self._xy = np.column_stack(np.broadcast_arrays(x, 
y)).astype(float)
668 self._x, self._y = self._xy.T  # views
669 

/usr/lib/python2.7/dist-packages/numpy/lib/stride_tricks.pyc in 
broadcast_arrays(*args, **kwargs)
247 args = [np.array(_m, copy=False, subok=subok) for _m in args]
248 
--> 249 shape = _broadcast_shape(*args)
250 
251 if all(array.shape == shape for array in args):

/usr/lib/python2.7/dist-packages/numpy/lib/stride_tricks.pyc in 
_broadcast_shape(*args)
182 # use the old-iterator because np.nditer does not handle size 0 
arrays
183 # consistently
--> 184 b = np.broadcast(*args[:32])
185 # unfortunately, it cannot handle 32 or more arguments directly
186 for pos in range(32, len(args), 31):

ValueError: shape mismatch: objects cannot be broadcast to a single
shape


Thanks for helping me!
Cheers
Paolo

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #690935]: makeVideo

2020-05-24 Thread Jan Stránský
Question #690935 on Yade changed:
https://answers.launchpad.net/yade/+question/690935

Jan Stránský proposed the following answer:
Hello,

> The error is something like :

please always provide as specific information as possible, not "something 
like", but the complete error [1].
I have tried the code, and the error says that the problem is at makeVideo 
function. The error message is a bit cryptic, but says something about mencoder 
(a linux external program). It was not installed on my system.
After
sudo apt install mencoder
the example works as expected

> It is as if the finish() function is not correctly read

is is read correctly, but the error is inside the function, so it exits
at makeVideo, before executing O.pause()

> I'm wondering if it is possible to make snapshots and videos of a
graph

For sure it is possible somehow, but **personally** I would do this in the 
post-processing stage.
One option is to use yade :-) loading the data in a cycle, in each cycle 
deleting the unwanted part, plot the desired data and save the figure.
Having series of pictures, making movie should be trivial.
(**personally** I would do also the graphics postprocessing externally in 
Paraview)

cheers
Jan

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

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #690935]: makeVideo

2020-05-24 Thread Bruno Chareyre
Question #690935 on Yade changed:
https://answers.launchpad.net/yade/+question/690935

Status: Open => Answered

Bruno Chareyre proposed the following answer:
Hi,

 > I'm wondering if it is possible to make snapshots and videos of a
graph plotted with the command plot.addData

Behind addData is just matplotlib, so you can just use standard 'save' 
functions from there. Something like
plt.savefig("snapshot"+str(O.iter)+".png")

Bruno

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp