← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2332: Sphinx documentation for plotting + color plotting.

 

------------------------------------------------------------
revno: 2332
committer: Janek Kozicki <cosurgi@xxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-07-08 19:17:28 +0200
message:
  Sphinx documentation for plotting + color plotting.
  Added missing comment in TriaxialCompressionEngine
added:
  doc/sphinx/fig/simple-scene-plot-1.png
  doc/sphinx/fig/simple-scene-plot-2.png
  doc/sphinx/fig/simple-scene-plot-3.png
modified:
  doc/sphinx/user.rst
  pkg/dem/Engine/PartialEngine/TriaxialCompressionEngine.hpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== added file 'doc/sphinx/fig/simple-scene-plot-1.png'
Binary files doc/sphinx/fig/simple-scene-plot-1.png	1970-01-01 00:00:00 +0000 and doc/sphinx/fig/simple-scene-plot-1.png	2010-07-08 17:17:28 +0000 differ
=== added file 'doc/sphinx/fig/simple-scene-plot-2.png'
Binary files doc/sphinx/fig/simple-scene-plot-2.png	1970-01-01 00:00:00 +0000 and doc/sphinx/fig/simple-scene-plot-2.png	2010-07-08 17:17:28 +0000 differ
=== added file 'doc/sphinx/fig/simple-scene-plot-3.png'
Binary files doc/sphinx/fig/simple-scene-plot-3.png	1970-01-01 00:00:00 +0000 and doc/sphinx/fig/simple-scene-plot-3.png	2010-07-08 17:17:28 +0000 differ
=== modified file 'doc/sphinx/user.rst'
--- doc/sphinx/user.rst	2010-07-06 08:14:52 +0000
+++ doc/sphinx/user.rst	2010-07-08 17:17:28 +0000
@@ -884,7 +884,130 @@
 
 Actual plot using data in :yref:`yade.plot.data` and plot specification of :yref:`yade.plot.plots` can be triggered by invoking the :yref:`yade.plot.plot` function.
 
-.. note:: Yade does not feature live-updates of figures (as much as it would be nice). If you are strong in python, you are welcome to take up this challenege.
+Live updates of plots
+---------------------
+
+Yade features live-updates of figures during calculations. It is controlled by following settings:
+
+* :yref:`yade.plot.live` - By setting ``yade.plot.live=True`` you can watch the plot being updated while the calculations run. Set to ``False`` otherwise.
+* :yref:`yade.plot.liveInterval` - This is the interval in seconds between the plot updates.
+* :yref:`yade.plot.autozoom` - When set to ``True`` the plot will be automatically rezoomed.
+
+Controlling line properties
+---------------------------
+
+In this subsection let us use a *basic complete script* like :ysrc:`examples/simple-scene/simple-scene-plot.py`, which we will later modify to make the plots prettier. Line of interest from that file is, and generates a picture presented below::
+	
+	plot.plots={'i':('t'),'t':('z_sph',None,('v_sph','go-'),'z_sph_half')}
+
+.. figure:: fig/simple-scene-plot-1.png
+
+	Figure generated by :ysrc:`examples/simple-scene/simple-scene-plot.py`.
+
+All line plots take an optional second string argument, which is composed of (optionally) a line color (eg, ’r’, ’g’, ’k’), a line style (eg, ’-’, ’–’, ’:’) and a line marker (’o’, ’s’, ’d’). For example a green dashed line with circle markers is created with ’go–’ argument.
+
+Following colors are available:
+
++------------+------------+
+|  character |   color    |
++============+============+
+|   ``b``    |  blue      |
++------------+------------+
+|   ``g``    |  green     |
++------------+------------+
+|   ``r``    |  red       |
++------------+------------+
+|   ``c``    |  cyan      |
++------------+------------+
+|   ``m``    |  magenta   |
++------------+------------+
+|   ``y``    |  yellow    |
++------------+------------+
+|   ``k``    |  black     |
++------------+------------+
+|   ``w``    |  white     |
++------------+------------+
+
+Following line styles are available:
+
++------------+-------------------------------+
+| character  |   description                 |
++============+===============================+
+|   ``-``    |        solid line style       |
++------------+-------------------------------+
+|   ``--``   |        dashed line style      |
++------------+-------------------------------+
+|   ``-.``   |        dash-dot line style    |
++------------+-------------------------------+
+|   ``:``    |        dotted line style      |
++------------+-------------------------------+
+|   ``.``    |        point marker           |
++------------+-------------------------------+
+|   ``,``    |        pixel marker           |
++------------+-------------------------------+
+|   ``o``    |        circle marker          |
++------------+-------------------------------+
+|   ``v``    |        triangle_down marker   |
++------------+-------------------------------+
+|   ``^``    |        triangle_up marker     |
++------------+-------------------------------+
+|   ``<``    |        triangle_left marker   |
++------------+-------------------------------+
+|   ``>``    |        triangle_right marker  |
++------------+-------------------------------+
+|   ``1``    |        tri_down marker        |
++------------+-------------------------------+
+|   ``2``    |        tri_up marker          |
++------------+-------------------------------+
+|   ``3``    |        tri_left marker        |
++------------+-------------------------------+
+|   ``4``    |        tri_right marker       |
++------------+-------------------------------+
+|   ``s``    |        square marker          |
++------------+-------------------------------+
+|   ``p``    |        pentagon marker        |
++------------+-------------------------------+
+|   ``*``    |        star marker            |
++------------+-------------------------------+
+|   ``h``    |        hexagon1 marker        |
++------------+-------------------------------+
+|   ``H``    |        hexagon2 marker        |
++------------+-------------------------------+
+|   ``+``    |        plus marker            |
++------------+-------------------------------+
+|   ``x``    |        x marker               |
++------------+-------------------------------+
+|   ``D``    |        diamond marker         |
++------------+-------------------------------+
+|   ``d``    |        thin_diamond marker    |
++------------+-------------------------------+
+|   ``|``    |        vline marker           |
++------------+-------------------------------+
+|   ``_``    |        hline marker           |
++------------+-------------------------------+
+
+For example using this line, will produce a following graph::
+
+	plot.plots={'i':(('t','xr:'),),'t':(('z_sph','r:'),None,('v_sph','g--'),('z_sph_half','b-.'))}
+
+.. figure:: fig/simple-scene-plot-2.png
+
+	Figure generated by changing parameters to plot.plots as above.
+
+And this line, will produce a following graph::
+
+	plot.plots={'i':(('t','xr:'),),'t':(('z_sph','Hr:'),None,('v_sph','+g--'),('z_sph_half','*b-.'))}
+
+.. figure:: fig/simple-scene-plot-2.png
+
+	Figure generated by changing parameters to plot.plots as above.
+
+.. note::
+	You can learn more by typing this command::
+
+		Yade [1]: help(yade.plot.pylab.plot)
+	
+.. note:: Please note that there is an extra ``,`` in ``'i':(('t','xr:'),)``, otherwise the ``'xr:'`` wouldn't be recognized as a line style parameter, but would be treated as an extra data to plot.
 
 Multiple figures
 ^^^^^^^^^^^^^^^^^

=== modified file 'pkg/dem/Engine/PartialEngine/TriaxialCompressionEngine.hpp'
--- pkg/dem/Engine/PartialEngine/TriaxialCompressionEngine.hpp	2010-07-07 18:13:32 +0000
+++ pkg/dem/Engine/PartialEngine/TriaxialCompressionEngine.hpp	2010-07-08 17:17:28 +0000
@@ -95,7 +95,7 @@
 		((bool,autoUnload,true,"Auto-switch from isotropic compaction to unloading"))
 		((bool,autoStopSimulation,true,"Stop the simulation when the sample reach STATE_LIMBO, or keep running"))
 		((int,testEquilibriumInterval,20,"interval of checks for transition between phases, higher than 1 saves computation time."))
-		((stateNum,currentState,1,""))
+		((stateNum,currentState,1,"There are 5 possible states in which TriaxialCompressionEngine can be. See above :yref:`yade.wrapper.TriaxialCompressionEngine` "))
 		((stateNum,previousState,1,"Previous state (used to detect manual changes of the state in .xml)"))
 		((Real,sigmaIsoCompaction,1,"Prescribed isotropic pressure during the compaction phase"))
 		((Real,previousSigmaIso,1,"Previous value of inherited sigma_iso (used to detect manual changes of the confining pressure)"))


Follow ups