diplotocus 0.6.4__tar.gz → 0.6.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. {diplotocus-0.6.4 → diplotocus-0.6.5}/PKG-INFO +1 -1
  2. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/api/core.rst +60 -0
  3. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/GUI.ipynb +1 -1
  4. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/plot_objects.ipynb +1 -0
  5. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/quick-start.ipynb +6 -6
  6. diplotocus-0.6.5/src/diplotocus/_version.py +1 -0
  7. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/animations.py +215 -75
  8. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus.egg-info/PKG-INFO +1 -1
  9. diplotocus-0.6.4/src/diplotocus/_version.py +0 -1
  10. {diplotocus-0.6.4 → diplotocus-0.6.5}/.gitattributes +0 -0
  11. {diplotocus-0.6.4 → diplotocus-0.6.5}/.gitignore +0 -0
  12. {diplotocus-0.6.4 → diplotocus-0.6.5}/.readthedocs.yaml +0 -0
  13. {diplotocus-0.6.4 → diplotocus-0.6.5}/LICENSE +0 -0
  14. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/Makefile +0 -0
  15. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/_static/force-light.css +0 -0
  16. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/_static/force-light.js +0 -0
  17. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/make.bat +0 -0
  18. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/requirements.txt +0 -0
  19. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/Web_GUI.png +0 -0
  20. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/button.svg +0 -0
  21. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/demo.mp4 +0 -0
  22. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/favicon.ico +0 -0
  23. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/force-light.css +0 -0
  24. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/force-light.js +0 -0
  25. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/logo.mp4 +0 -0
  26. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/_static/logo.svg +0 -0
  27. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/api/index.rst +0 -0
  28. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/conf.py +0 -0
  29. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/index.rst +0 -0
  30. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/animations.ipynb +0 -0
  31. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/easings.ipynb +0 -0
  32. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/index.ipynb +0 -0
  33. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/installation.ipynb +0 -0
  34. {diplotocus-0.6.4 → diplotocus-0.6.5}/docs/source/notebooks/timeline.ipynb +0 -0
  35. {diplotocus-0.6.4 → diplotocus-0.6.5}/logo.png +0 -0
  36. {diplotocus-0.6.4 → diplotocus-0.6.5}/pyproject.toml +0 -0
  37. {diplotocus-0.6.4 → diplotocus-0.6.5}/readme.md +0 -0
  38. {diplotocus-0.6.4 → diplotocus-0.6.5}/setup.cfg +0 -0
  39. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/GUI.html +0 -0
  40. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/__init__.py +0 -0
  41. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/app.js +0 -0
  42. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/server.py +0 -0
  43. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/bg.png +0 -0
  44. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_Draw.png +0 -0
  45. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_Morph.png +0 -0
  46. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_Rotate.png +0 -0
  47. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_Scale.png +0 -0
  48. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_Sequence.png +0 -0
  49. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_Translate.png +0 -0
  50. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_Tween.png +0 -0
  51. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/btn/btn_bg_default.png +0 -0
  52. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/favicon.ico +0 -0
  53. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/src/logo_bg.png +0 -0
  54. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/GUI/style.css +0 -0
  55. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/__init__.py +0 -0
  56. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/core.py +0 -0
  57. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus/easings.py +0 -0
  58. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus.egg-info/SOURCES.txt +0 -0
  59. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus.egg-info/dependency_links.txt +0 -0
  60. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus.egg-info/requires.txt +0 -0
  61. {diplotocus-0.6.4 → diplotocus-0.6.5}/src/diplotocus.egg-info/top_level.txt +0 -0
  62. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test.py +0 -0
  63. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test10.py +0 -0
  64. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test2.py +0 -0
  65. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test3.py +0 -0
  66. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test4.py +0 -0
  67. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test5.py +0 -0
  68. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test6.py +0 -0
  69. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test7.py +0 -0
  70. {diplotocus-0.6.4 → diplotocus-0.6.5}/tests/test8.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diplotocus
3
- Version: 0.6.4
3
+ Version: 0.6.5
4
4
  Summary: A python package to generate animations of matplotlib objects.
5
5
  Author-email: Tristan Boin <tristan.boin@obspm.fr>
6
6
  License-Expression: MIT
@@ -31,10 +31,18 @@ Axis and figure animations
31
31
  :members:
32
32
  :undoc-members:
33
33
 
34
+ .. autoclass:: diplotocus.animations.axis_pos_and_size
35
+ :members:
36
+ :undoc-members:
37
+
34
38
  .. autoclass:: diplotocus.animations.axis_move
35
39
  :members:
36
40
  :undoc-members:
37
41
 
42
+ .. autoclass:: diplotocus.animations.axis_track
43
+ :members:
44
+ :undoc-members:
45
+
38
46
  .. autoclass:: diplotocus.animations.axis_alpha
39
47
  :members:
40
48
  :undoc-members:
@@ -102,6 +110,58 @@ Plot object animations
102
110
  :members:
103
111
  :undoc-members:
104
112
 
113
+ .. autoclass:: diplotocus.animations.Circle
114
+ :members:
115
+ :undoc-members:
116
+
117
+ .. autoclass:: diplotocus.animations.fill
118
+ :members:
119
+ :undoc-members:
120
+
121
+ .. autoclass:: diplotocus.animations.Annulus
122
+ :members:
123
+ :undoc-members:
124
+
125
+ .. autoclass:: diplotocus.animations.Arc
126
+ :members:
127
+ :undoc-members:
128
+
129
+ .. autoclass:: diplotocus.animations.Arrow
130
+ :members:
131
+ :undoc-members:
132
+
133
+ .. autoclass:: diplotocus.animations.Ellipse
134
+ :members:
135
+ :undoc-members:
136
+
137
+ .. autoclass:: diplotocus.animations.FancyArrow
138
+ :members:
139
+ :undoc-members:
140
+
141
+ .. autoclass:: diplotocus.animations.Polygon
142
+ :members:
143
+ :undoc-members:
144
+
145
+ .. autoclass:: diplotocus.animations.Rectangle
146
+ :members:
147
+ :undoc-members:
148
+
149
+ .. autoclass:: diplotocus.animations.RegularPolygon
150
+ :members:
151
+ :undoc-members:
152
+
153
+ .. autoclass:: diplotocus.animations.Wedge
154
+ :members:
155
+ :undoc-members:
156
+
157
+ .. autoclass:: diplotocus.animations.bar
158
+ :members:
159
+ :undoc-members:
160
+
161
+ .. autoclass:: diplotocus.animations.ConnectionPatch
162
+ :members:
163
+ :undoc-members:
164
+
105
165
  Easings
106
166
  -------
107
167
 
@@ -16,7 +16,7 @@
16
16
  "The GUI might not be as stable as the python interface and is currently lacking recently added features. Feel free to report any issues you encounter or features you want to see be added in priority.\n",
17
17
  "```\n",
18
18
  "\n",
19
- "When running diplotocus through this mode, you will make edit your animation through a local web page in your browser. This page communicates with a python server, which links the GUI and diplotocus objects in the background. Hence, everything you can do through python, you can do through the GUI, and vice versa.\n",
19
+ "When running diplotocus through this mode, you will edit your animation through a local web page in your browser. This page communicates with a python server, which links the GUI and diplotocus objects in the background. Hence, everything you can do through python, you can do through the GUI, and vice versa.\n",
20
20
  "\n",
21
21
  "```{note}\n",
22
22
  "\n",
@@ -35,6 +35,7 @@
35
35
  "- `RegularPolygon()`\n",
36
36
  "- `Wedge()`\n",
37
37
  "- `bar()`\n",
38
+ "- `ConnectionPatch()`\n",
38
39
  "\n",
39
40
  "Their signature are the same as the [matplotlib ones](https://matplotlib.org).\n",
40
41
  "\n",
@@ -10,10 +10,10 @@
10
10
  "This page will guide you through the syntax and feature of Diplotocus.\n",
11
11
  "\n",
12
12
  "First, here are a few terms we will be using:\n",
13
- "- a `Timeline` is the main object of a project. It holds the figure, axes, and is responsible for running animations and rendering the video (See [Timeline](timeline) for more information).\n",
14
- "- a `plot object` is any matplotlib plotting function you are familiar with: `plot()`, `scatter()`, `hist()`, `text()`... (See [Plot objects](plot_objects) for more information).\n",
15
- "- an `animation` is what is applied to `plot objects` to animate it: `translate()`,`rotate()`,`tween`... (See [Animations](animations) for more information).\n",
16
- "- an `easing` is a mapping between frame number and time, that might not be linear ({doc}`See Easings <easings>` for more information).\n",
13
+ "- a *Timeline* is the main object of a project. It holds the figure, axes, and is responsible for running animations and rendering the video (See [Timeline](timeline) for more information).\n",
14
+ "- a *plot object* is any matplotlib plotting function you are familiar with: `plot()`, `scatter()`, `hist()`, `text()`... (See [Plot objects](plot_objects) for more information).\n",
15
+ "- an *animation* is what is applied to `plot objects` to animate it: `translate()`,`rotate()`,`tween`... (See [Animations](animations) for more information).\n",
16
+ "- an *easing* is a mapping between frame number and time, that might not be linear ({doc}`See Easings <easings>` for more information).\n",
17
17
  "\n",
18
18
  "The basic steps involved in creating animations are the following:\n",
19
19
  "1. Create a `Timeline` object. Optionally, you can give it an existing figure, or define its initial properties.\n",
@@ -26,7 +26,7 @@
26
26
  "\n",
27
27
  "Let's go through the example on the main page step by step:\n",
28
28
  "\n",
29
- "First, we import our modules. By convention, we import diplotocus as dpl, *à la* import matplotlib.pyplot as plt."
29
+ "First, we import our modules. By convention, we `import diplotocus as dpl`, *à la* `import matplotlib.pyplot as plt`."
30
30
  ]
31
31
  },
32
32
  {
@@ -138,7 +138,7 @@
138
138
  "id": "92f889da",
139
139
  "metadata": {},
140
140
  "source": [
141
- "We want to animate our axis, by zooming out and moving its center to (0,0), simultaneously. We define our two animations, `axis_zoom` and `axis_move`, and we animate them through our `Timeline`."
141
+ "Now we want to animate our axis, by zooming out and moving its center to (0,0), simultaneously. We define our two animations, `axis_zoom` and `axis_move`, and we animate them through our `Timeline`."
142
142
  ]
143
143
  },
144
144
  {
@@ -0,0 +1 @@
1
+ __version__ = "0.6.5"
@@ -29,7 +29,10 @@ def dealias(mpl_obj,kwargs):
29
29
  def to_np_array(obj):
30
30
  if type(obj) == np.ndarray:
31
31
  return obj
32
- obj = np.array(obj)
32
+ try:
33
+ obj = np.array(obj)
34
+ except:
35
+ obj = np.array(obj,dtype=object)
33
36
  if obj.ndim == 0:
34
37
  obj = np.ravel(obj)
35
38
  return obj
@@ -150,6 +153,8 @@ class plotObject:
150
153
  if idx is None:
151
154
  kwargs[key] = to_np_array([])
152
155
  else:
156
+ if isinstance(idx,(list,np.ndarray)):
157
+ idx = [i for i in idx if i < len(kwarg)]
153
158
  kwargs[key] = to_np_array(kwarg)[idx]
154
159
  return kwargs
155
160
 
@@ -159,10 +164,10 @@ class plotObject:
159
164
 
160
165
  i_min,i_max = -1,-1
161
166
 
162
- if 'alpha' in kwargs:
163
- alpha = to_np_array(kwargs['alpha'])
164
- if np.sum(alpha) == 0:
165
- kwargs['alpha'] = 1
167
+ #if 'alpha' in kwargs:
168
+ #alpha = to_np_array(kwargs['alpha'])
169
+ #if np.sum(alpha) == 0:
170
+ #kwargs['alpha'] = 1
166
171
 
167
172
  for anim in self.anims:
168
173
  if anim['name'] != 'sample':
@@ -185,7 +190,7 @@ class plotObject:
185
190
  data_y = data_y.reshape(-1)
186
191
  kwargs = self.resize_kwargs(kwargs,list(range(i_min,i_max)))
187
192
 
188
- #Third pass to morph
193
+ #Second pass to morph
189
194
  for anim in self.anims:
190
195
  if anim['name'] != 'morph':
191
196
  continue
@@ -206,7 +211,7 @@ class plotObject:
206
211
  else:
207
212
  _t = t
208
213
  new_data_x.append(data_x[i] + (anim['new_x'][i] - data_x[i])*_t)
209
- if len(data_y) == len(anim['new_y']):
214
+ if len(data_y) == len(data_x):
210
215
  new_data_y.append(data_y[i] + (anim['new_y'][i] - data_y[i])*_t)
211
216
  data_x = new_data_x
212
217
  data_y = new_data_y
@@ -277,13 +282,13 @@ class plotObject:
277
282
  i_min = int((_x + anim['min'])/anim['duration']*len_data)
278
283
  i_min = max(i_min,0)
279
284
  if type(anim['max']) == str and anim['max'] == 'end':
280
- i_max = len_data - 1
285
+ i_max = len_data+1
281
286
  else:
282
287
  if anim['max'] == anim['min']:
283
288
  i_max = i_min + 1
284
289
  else:
285
- i_max = int((_x + anim['max'])/anim['duration']*len_data)
286
- i_max = min(i_max,len_data-1)
290
+ i_max = int((_x + anim['max'])/(anim['duration']-1)*(len_data+1))
291
+ i_max = min(i_max,len_data+1)
287
292
  return i_min,i_max
288
293
 
289
294
  def get_sequential_t(self,i,x,size,anim):
@@ -1135,7 +1140,7 @@ class axis_pos_and_size(plotObject):
1135
1140
  Target width
1136
1141
  end_height : float
1137
1142
  Target height
1138
- start_left = float
1143
+ start_left : float
1139
1144
  Initial left position
1140
1145
  start_bottom : float
1141
1146
  Initial bottom position
@@ -1143,10 +1148,6 @@ class axis_pos_and_size(plotObject):
1143
1148
  Initial width
1144
1149
  start_height : float
1145
1150
  Initial height
1146
- pos : array-like
1147
- Target left and bottom position
1148
- size : array-like
1149
- Target width and height
1150
1151
  duration : float
1151
1152
  Duration of the animation
1152
1153
  delay : float, default=0
@@ -1197,9 +1198,8 @@ class axis_pos_and_size(plotObject):
1197
1198
 
1198
1199
  def function(self,data_x,data_y,x,kwargs):
1199
1200
  anim = self.anims[0]
1200
- if x < anim['delay']:
1201
+ if x < anim['delay'] or x >= anim['delay'] + anim['duration']:
1201
1202
  return
1202
- _x = min(x,anim['duration'] + anim['delay']-1)
1203
1203
  t = self.get_t_from_x(anim,x)
1204
1204
  width = self.axis.get_xlim()[1]-self.axis.get_xlim()[0]
1205
1205
  height = self.axis.get_ylim()[1]-self.axis.get_ylim()[0]
@@ -1414,11 +1414,9 @@ class fig_width_ratio(plotObject):
1414
1414
  Delay before starting
1415
1415
  easing : callable, optional
1416
1416
  Easing function
1417
- axis : matplotlib.axes.Axes, optional
1418
- Axis to plot on
1419
1417
  """
1420
- def __init__(self,start_widths,end_widths,duration,delay=0,easing=None,axis=None,*args,**kwargs):
1421
- super().__init__(axis=axis,*args, **kwargs)
1418
+ def __init__(self,start_widths,end_widths,duration,delay=0,easing=None,*args,**kwargs):
1419
+ super().__init__(*args, **kwargs)
1422
1420
  self.grid = None
1423
1421
  start_widths = to_np_array(start_widths).astype(float)
1424
1422
  end_widths = to_np_array(end_widths).astype(float)
@@ -1485,11 +1483,9 @@ class fig_height_ratio(plotObject):
1485
1483
  Delay before starting
1486
1484
  easing : callable, optional
1487
1485
  Easing function
1488
- axis : matplotlib.axes.Axes, optional
1489
- Axis to plot on
1490
1486
  """
1491
- def __init__(self,start_heights,end_heights,duration,delay=0,easing=None,axis=None,*args,**kwargs):
1492
- super().__init__(axis=axis,*args, **kwargs)
1487
+ def __init__(self,start_heights,end_heights,duration,delay=0,easing=None,*args,**kwargs):
1488
+ super().__init__(*args, **kwargs)
1493
1489
  self.grid = None
1494
1490
  start_heights = to_np_array(start_heights)
1495
1491
  end_heights = to_np_array(end_heights)
@@ -1549,10 +1545,6 @@ class scatter(plotObject):
1549
1545
  x, y : float or array-like, shape (n, )
1550
1546
  The data positions.
1551
1547
 
1552
- duration : float
1553
- Duration of the animation
1554
- delay : float, default=0
1555
- Delay before starting
1556
1548
  easing : callable, optional
1557
1549
  Easing function
1558
1550
  axis : matplotlib.axes.Axes, optional
@@ -1863,10 +1855,6 @@ class plot(plotObject):
1863
1855
  The horizontal / vertical coordinates of the data points.
1864
1856
  *x* values are optional and default to ``range(len(y))``.
1865
1857
 
1866
- duration : float
1867
- Duration of the animation
1868
- delay : float, default=0
1869
- Delay before starting
1870
1858
  easing : callable, optional
1871
1859
  Easing function
1872
1860
  axis : matplotlib.axes.Axes, optional
@@ -2084,6 +2072,7 @@ class plot(plotObject):
2084
2072
  def function(self,data_x,data_y,x,kwargs):
2085
2073
  if 'alpha' in kwargs and isinstance(kwargs['alpha'],np.ndarray):
2086
2074
  kwargs['alpha'] = kwargs['alpha'][0]
2075
+
2087
2076
  self.obj = self.axis.plot(data_x,data_y,**kwargs)
2088
2077
 
2089
2078
  class step(plotObject):
@@ -2117,6 +2106,11 @@ class step(plotObject):
2117
2106
  y : array-like
2118
2107
  1D sequence of y levels.
2119
2108
 
2109
+ easing : callable, optional
2110
+ Easing function
2111
+ axis : matplotlib.axes.Axes, optional
2112
+ Axis to plot on
2113
+
2120
2114
  fmt : str, optional
2121
2115
  A format string, e.g. 'g' for a green line. See `.plot` for a more
2122
2116
  detailed description.
@@ -2185,10 +2179,6 @@ class fill_between(plotObject):
2185
2179
  x : array-like
2186
2180
  The x coordinates of the nodes defining the curves.
2187
2181
 
2188
- duration : float
2189
- Duration of the animation
2190
- delay : float, default=0
2191
- Delay before starting
2192
2182
  easing : callable, optional
2193
2183
  Easing function
2194
2184
  axis : matplotlib.axes.Axes, optional
@@ -2383,10 +2373,6 @@ class fill_betweenx(plotObject):
2383
2373
  y : array-like
2384
2374
  The y coordinates of the nodes defining the curves.
2385
2375
 
2386
- duration : float
2387
- Duration of the animation
2388
- delay : float, default=0
2389
- Delay before starting
2390
2376
  easing : callable, optional
2391
2377
  Easing function
2392
2378
  axis : matplotlib.axes.Axes, optional
@@ -2574,10 +2560,6 @@ class axvline(plotObject):
2574
2560
  x : float, default: 0
2575
2561
  x position in :ref:`data coordinates <coordinate-systems>`.
2576
2562
 
2577
- duration : float
2578
- Duration of the animation
2579
- delay : float, default=0
2580
- Delay before starting
2581
2563
  easing : callable, optional
2582
2564
  Easing function
2583
2565
  axis : matplotlib.axes.Axes, optional
@@ -2713,6 +2695,11 @@ class axhline(plotObject):
2713
2695
  y : float, default: 0
2714
2696
  y position in :ref:`data coordinates <coordinate-systems>`.
2715
2697
 
2698
+ easing : callable, optional
2699
+ Easing function
2700
+ axis : matplotlib.axes.Axes, optional
2701
+ Axis to plot on
2702
+
2716
2703
  xmin : float, default: 0
2717
2704
  The start x-position in :ref:`axes coordinates <coordinate-systems>`.
2718
2705
  Should be between 0 and 1, 0 being the far left of the plot,
@@ -2796,10 +2783,6 @@ class errorbar(plotObject):
2796
2783
  x, y : float or array-like
2797
2784
  The data positions.
2798
2785
 
2799
- duration : float
2800
- Duration of the animation
2801
- delay : float, default=0
2802
- Delay before starting
2803
2786
  easing : callable, optional
2804
2787
  Easing function
2805
2788
  axis : matplotlib.axes.Axes, optional
@@ -3056,10 +3039,6 @@ class hist(plotObject):
3056
3039
  Input values, this takes either a single array or a sequence of
3057
3040
  arrays which are not required to be of the same length.
3058
3041
 
3059
- duration : float
3060
- Duration of the animation
3061
- delay : float, default=0
3062
- Delay before starting
3063
3042
  easing : callable, optional
3064
3043
  Easing function
3065
3044
  axis : matplotlib.axes.Axes, optional
@@ -3286,10 +3265,6 @@ class hist2d(plotObject):
3286
3265
  x, y : array-like, shape (n, )
3287
3266
  Input values
3288
3267
 
3289
- duration : float
3290
- Duration of the animation
3291
- delay : float, default=0
3292
- Delay before starting
3293
3268
  easing : callable, optional
3294
3269
  Easing function
3295
3270
  axis : matplotlib.axes.Axes, optional
@@ -3456,10 +3431,6 @@ class contourf(plotObject):
3456
3431
  X, Y : array-like, optional
3457
3432
  The coordinates of the values in *Z*.
3458
3433
 
3459
- duration : float
3460
- Duration of the animation
3461
- delay : float, default=0
3462
- Delay before starting
3463
3434
  easing : callable, optional
3464
3435
  Easing function
3465
3436
  axis : matplotlib.axes.Axes, optional
@@ -3819,10 +3790,6 @@ class text(plotObject):
3819
3790
 
3820
3791
  A dictionary to override the default text properties. If fontdict
3821
3792
  is None, the defaults are determined by `.rcParams`.
3822
- duration : float
3823
- Duration of the animation
3824
- delay : float, default=0
3825
- Delay before starting
3826
3793
  easing : callable, optional
3827
3794
  Easing function
3828
3795
  axis : matplotlib.axes.Axes, optional
@@ -4054,6 +4021,10 @@ class svg(plotObject):
4054
4021
  the edge color.
4055
4022
  lw : float, default=2
4056
4023
  the line width.
4024
+ easing : callable, optional
4025
+ Easing function
4026
+ axis : matplotlib.axes.Axes, optional
4027
+ Axis to plot on
4057
4028
  """
4058
4029
  def __init__(self, data, fc=None, ec='k', lw=2,easing=None,axis=None, *args, **kwargs):
4059
4030
  self.mpl_obj_type = mpl.patches.PathPatch
@@ -4126,6 +4097,17 @@ class Circle(plotObject):
4126
4097
 
4127
4098
  Create a true circle at center *xy* = (*x*, *y*) with given *radius*.
4128
4099
 
4100
+ Parameters
4101
+ ----------
4102
+ xy : (float, float)
4103
+ xy coordinates of circle centre.
4104
+ r : float
4105
+ The radius
4106
+ easing : callable, optional
4107
+ Easing function
4108
+ axis : matplotlib.axes.Axes, optional
4109
+ Axis to plot on
4110
+
4129
4111
  Unlike `CirclePolygon` which is a polygonal approximation, this uses
4130
4112
  Bezier splines and is much closer to a scale-free circle.
4131
4113
  """
@@ -4175,6 +4157,11 @@ class fill(plotObject):
4175
4157
  ax.fill("time", "signal",
4176
4158
  data={"time": [0, 1, 2], "signal": [0, 1, 0]})
4177
4159
 
4160
+ easing : callable, optional
4161
+ Easing function
4162
+ axis : matplotlib.axes.Axes, optional
4163
+ Axis to plot on
4164
+
4178
4165
  Returns
4179
4166
  -------
4180
4167
  list of `~matplotlib.patches.Polygon`
@@ -4224,6 +4211,10 @@ class Annulus(plotObject):
4224
4211
  angle : float, default: 0
4225
4212
  Rotation angle in degrees (anti-clockwise from the positive
4226
4213
  x-axis). Ignored for circular annuli (i.e., if *r* is a scalar).
4214
+ easing : callable, optional
4215
+ Easing function
4216
+ axis : matplotlib.axes.Axes, optional
4217
+ Axis to plot on
4227
4218
  """
4228
4219
  def __init__(self,xy,r,width,angle=0.0,easing=None,axis=None, *args, **kwargs):
4229
4220
  self.mpl_obj_type = mpl.patches.Circle
@@ -4272,6 +4263,12 @@ class Arc(plotObject):
4272
4263
  represented by an equivalent angle in the range [0, 360), by
4273
4264
  taking the input value mod 360.
4274
4265
 
4266
+ easing : callable, optional
4267
+ Easing function
4268
+
4269
+ axis : matplotlib.axes.Axes, optional
4270
+ Axis to plot on
4271
+
4275
4272
  Other Parameters
4276
4273
  ----------------
4277
4274
  **kwargs : `~matplotlib.patches.Patch` properties
@@ -4323,6 +4320,10 @@ class Arrow(plotObject):
4323
4320
  width : float, default: 1
4324
4321
  Scale factor for the width of the arrow. With a default value of 1,
4325
4322
  the tail width is 0.2 and head width is 0.6.
4323
+ easing : callable, optional
4324
+ Easing function
4325
+ axis : matplotlib.axes.Axes, optional
4326
+ Axis to plot on
4326
4327
  **kwargs
4327
4328
  Keyword arguments control the `Patch` properties:
4328
4329
 
@@ -4366,6 +4367,10 @@ class Ellipse(plotObject):
4366
4367
  Total length (diameter) of vertical axis.
4367
4368
  angle : float, default: 0
4368
4369
  Rotation in degrees anti-clockwise.
4370
+ easing : callable, optional
4371
+ Easing function
4372
+ axis : matplotlib.axes.Axes, optional
4373
+ Axis to plot on
4369
4374
  """
4370
4375
  def __init__(self,xy,width,height,angle=0,easing=None,axis=None, *args, **kwargs):
4371
4376
  self.mpl_obj_type = mpl.patches.Ellipse
@@ -4418,6 +4423,12 @@ class FancyArrow(plotObject):
4418
4423
  head_starts_at_zero : bool, default: False
4419
4424
  If True, the head starts being drawn at coordinate 0
4420
4425
  instead of ending at coordinate 0.
4426
+
4427
+ easing : callable, optional
4428
+ Easing function
4429
+
4430
+ axis : matplotlib.axes.Axes, optional
4431
+ Axis to plot on
4421
4432
  """
4422
4433
  def __init__(self,x,y,dx,dy,width=0.001,
4423
4434
  length_includes_head=False,head_width=None,head_length=None,
@@ -4464,6 +4475,12 @@ class Polygon(plotObject):
4464
4475
  closed : bool, default: True
4465
4476
  Whether the polygon is closed (i.e., has identical start and end
4466
4477
  points).
4478
+
4479
+ easing : callable, optional
4480
+ Easing function
4481
+
4482
+ axis : matplotlib.axes.Axes, optional
4483
+ Axis to plot on
4467
4484
  """
4468
4485
  def __init__(self,xy,closed=True,easing=None,axis=None, *args, **kwargs):
4469
4486
  self.mpl_obj_type = mpl.patches.Polygon
@@ -4512,6 +4529,10 @@ class Rectangle(plotObject):
4512
4529
  If ``'xy'``, rotate around the anchor point. If ``'center'`` rotate
4513
4530
  around the center. If 2-tuple of number, rotate around this
4514
4531
  coordinate.
4532
+ easing : callable, optional
4533
+ Easing function
4534
+ axis : matplotlib.axes.Axes, optional
4535
+ Axis to plot on
4515
4536
  """
4516
4537
  def __init__(self,xy,width,height,angle=0.0,rotation_point='xy',easing=None,axis=None, *args, **kwargs):
4517
4538
  self.mpl_obj_type = mpl.patches.Rectangle
@@ -4553,6 +4574,12 @@ class RegularPolygon(plotObject):
4553
4574
 
4554
4575
  orientation : float
4555
4576
  The polygon rotation angle (in radians).
4577
+
4578
+ easing : callable, optional
4579
+ Easing function
4580
+
4581
+ axis : matplotlib.axes.Axes, optional
4582
+ Axis to plot on
4556
4583
  """
4557
4584
  def __init__(self,xy,numVertices,radius=5,orientation=0,easing=None,axis=None, *args, **kwargs):
4558
4585
  self.mpl_obj_type = mpl.patches.RegularPolygon
@@ -4579,6 +4606,23 @@ class Wedge(plotObject):
4579
4606
  """
4580
4607
  Wedge shaped patch.
4581
4608
 
4609
+ Parameters
4610
+ ----------
4611
+ center : (float,float)
4612
+ The center of the wedge
4613
+ r : float
4614
+ The radius of the wedge
4615
+ theta1 : float
4616
+ The first angle (in degrees) of the wedge
4617
+ theta2 : float
4618
+ The second angle (in degrees) of the wedge
4619
+ width : float, optional
4620
+ The width of the partial wedge
4621
+ easing : callable, optional
4622
+ Easing function
4623
+ axis : matplotlib.axes.Axes, optional
4624
+ Axis to plot on
4625
+
4582
4626
  A wedge centered at *x*, *y* center with radius *r* that
4583
4627
  sweeps *theta1* to *theta2* (in degrees). If *width* is given,
4584
4628
  then a partial wedge is drawn from inner radius *r* - *width*
@@ -4662,6 +4706,12 @@ class bar(plotObject):
4662
4706
  To align the bars on the right edge pass a negative *width* and
4663
4707
  ``align='edge'``.
4664
4708
 
4709
+ easing : callable, optional
4710
+ Easing function
4711
+
4712
+ axis : matplotlib.axes.Axes, optional
4713
+ Axis to plot on
4714
+
4665
4715
  Returns
4666
4716
  -------
4667
4717
  `.BarContainer`
@@ -4669,15 +4719,15 @@ class bar(plotObject):
4669
4719
 
4670
4720
  Other Parameters
4671
4721
  ----------------
4672
- color : :mpltype:`color` or list of :mpltype:`color`, optional
4722
+ color : ``color`` or list of ``color``, optional
4673
4723
  The colors of the bar faces. This is an alias for *facecolor*.
4674
4724
  If both are given, *facecolor* takes precedence.
4675
4725
 
4676
- facecolor : :mpltype:`color` or list of :mpltype:`color`, optional
4726
+ facecolor : ``color`` or list of ``color``, optional
4677
4727
  The colors of the bar faces.
4678
4728
  If both *color* and *facecolor are given, *facecolor* takes precedence.
4679
4729
 
4680
- edgecolor : :mpltype:`color` or list of :mpltype:`color`, optional
4730
+ edgecolor : ``color`` or list of ``color``, optional
4681
4731
  The colors of the bar edges.
4682
4732
 
4683
4733
  linewidth : float or array-like, optional
@@ -4706,13 +4756,10 @@ class bar(plotObject):
4706
4756
  errors.
4707
4757
  - *None*: No errorbar. (Default)
4708
4758
 
4709
- See :doc:`/gallery/statistics/errorbar_features` for an example on
4710
- the usage of *xerr* and *yerr*.
4711
-
4712
- ecolor : :mpltype:`color` or list of :mpltype:`color`, default: 'black'
4759
+ ecolor : ``color`` or list of ``color``, default: 'black'
4713
4760
  The line color of the errorbars.
4714
4761
 
4715
- capsize : float, default: :rc:`errorbar.capsize`
4762
+ capsize : float, default: ``errorbar.capsize``
4716
4763
  The length of the error bar caps in points.
4717
4764
 
4718
4765
  error_kw : dict, optional
@@ -4737,7 +4784,7 @@ class bar(plotObject):
4737
4784
  Notes
4738
4785
  -----
4739
4786
  Stacked bars can be achieved by passing individual *bottom* values per
4740
- bar. See :doc:`/gallery/lines_bars_and_markers/bar_stacked`.
4787
+ bar.
4741
4788
  """
4742
4789
  def __init__(self,x,height,width=0.8,bottom=0,easing=None,axis=None, *args, **kwargs):
4743
4790
  #self.mpl_obj_type = mpl.container.BarContainer
@@ -4797,4 +4844,97 @@ class bar(plotObject):
4797
4844
  kwargs['width'] = [0]
4798
4845
  kwargs['bottom'] = [0]
4799
4846
  obj = self.axis.bar(data_x,data_y,**kwargs)
4800
- self.obj = obj
4847
+ self.obj = obj
4848
+
4849
+ class ConnectionPatch(plotObject):
4850
+ """
4851
+ Connect point *xyA* in *coordsA* with point *xyB* in *coordsB*.
4852
+
4853
+ Parameters
4854
+ ----------
4855
+ easing : callable, optional
4856
+ Easing function
4857
+ axis : matplotlib.axes.Axes, optional
4858
+ Axis to plot on
4859
+
4860
+ Valid keys are
4861
+
4862
+ =============== ======================================================
4863
+ Key Description
4864
+ =============== ======================================================
4865
+ arrowstyle the arrow style
4866
+ connectionstyle the connection style
4867
+ relpos default is (0.5, 0.5)
4868
+ patchA default is bounding box of the text
4869
+ patchB default is None
4870
+ shrinkA default is 2 points
4871
+ shrinkB default is 2 points
4872
+ mutation_scale default is text size (in points)
4873
+ mutation_aspect default is 1.
4874
+ ? any key for `matplotlib.patches.PathPatch`
4875
+ =============== ======================================================
4876
+
4877
+ *coordsA* and *coordsB* are strings that indicate the
4878
+ coordinates of *xyA* and *xyB*.
4879
+
4880
+ ==================== ==================================================
4881
+ Property Description
4882
+ ==================== ==================================================
4883
+ 'figure points' points from the lower left corner of the figure
4884
+ 'figure pixels' pixels from the lower left corner of the figure
4885
+ 'figure fraction' 0, 0 is lower left of figure and 1, 1 is upper
4886
+ right
4887
+ 'subfigure points' points from the lower left corner of the subfigure
4888
+ 'subfigure pixels' pixels from the lower left corner of the subfigure
4889
+ 'subfigure fraction' fraction of the subfigure, 0, 0 is lower left.
4890
+ 'axes points' points from lower left corner of the Axes
4891
+ 'axes pixels' pixels from lower left corner of the Axes
4892
+ 'axes fraction' 0, 0 is lower left of Axes and 1, 1 is upper right
4893
+ 'data' use the coordinate system of the object being
4894
+ annotated (default)
4895
+ 'offset points' offset (in points) from the *xy* value
4896
+ 'polar' you can specify *theta*, *r* for the annotation,
4897
+ even in cartesian plots. Note that if you are
4898
+ using a polar Axes, you do not need to specify
4899
+ polar for the coordinate system since that is the
4900
+ native "data" coordinate system.
4901
+ ==================== ==================================================
4902
+
4903
+ Alternatively they can be set to any valid
4904
+ `~matplotlib.transforms.Transform`.
4905
+
4906
+ Note that 'subfigure pixels' and 'figure pixels' are the same
4907
+ for the parent figure, so users who want code that is usable in
4908
+ a subfigure can use 'subfigure pixels'.
4909
+
4910
+ .. note::
4911
+
4912
+ Using `ConnectionPatch` across two `~.axes.Axes` instances
4913
+ is not directly compatible with :ref:`constrained layout
4914
+ <constrainedlayout_guide>`. Add the artist
4915
+ directly to the `.Figure` instead of adding it to a specific Axes,
4916
+ or exclude it from the layout using ``con.set_in_layout(False)``.
4917
+
4918
+ .. code-block:: default
4919
+
4920
+ fig, ax = plt.subplots(1, 2, constrained_layout=True)
4921
+ con = ConnectionPatch(..., axesA=ax[0], axesB=ax[1])
4922
+ fig.add_artist(con)
4923
+
4924
+ """
4925
+ def __init__(self,xyA,xyB,coordsA,coordsB=None,easing=None,axis=None, *args, **kwargs):
4926
+ self.mpl_obj_type = mpl.patches.FancyArrowPatch
4927
+ kwargs['xyA'] = xyA
4928
+ kwargs['xyB'] = xyB
4929
+ kwargs['coordsA'] = coordsA
4930
+ kwargs['coordsB'] = coordsB
4931
+ super().__init__(easing=easing,axis=axis,*args, **kwargs)
4932
+ self.x = xyA[0]
4933
+ self.y = xyA[1]
4934
+
4935
+ def function(self,data_x,data_y,x,kwargs):
4936
+ if 'alpha' in kwargs and isinstance(kwargs['alpha'],np.ndarray):
4937
+ kwargs['alpha'] = kwargs['alpha'][0]
4938
+
4939
+ self.obj = mpl.patches.ConnectionPatch(**kwargs)
4940
+ self.axis.add_patch(self.obj)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diplotocus
3
- Version: 0.6.4
3
+ Version: 0.6.5
4
4
  Summary: A python package to generate animations of matplotlib objects.
5
5
  Author-email: Tristan Boin <tristan.boin@obspm.fr>
6
6
  License-Expression: MIT
@@ -1 +0,0 @@
1
- __version__ = "0.6.4"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes