···
[](https://github.com/cduck/drawSvg/blob/master/examples/example4.svg)
···

···

-
### SVG-Native Animation
-
d = draw.Drawing(200, 200, origin='center')
-
# Animate the position and color of circle
-
c = draw.Circle(0, 0, 20, fill='red')
-
# See for supported attributes:
-
# https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animate
-
c.appendAnim(draw.Animate('cy', '6s', '-80;80;-80',
-
repeatCount='indefinite'))
-
c.appendAnim(draw.Animate('cx', '6s', '0;80;0;-80;0',
-
repeatCount='indefinite'))
-
c.appendAnim(draw.Animate('fill', '6s', 'red;green;blue;yellow',
-
repeatCount='indefinite'))
-
# Animate a black circle around an ellipse
-
ellipse.A(90, 40, 360, True, True, 90, 0) # Ellipse path
-
ellipse.A(90, 40, 360, True, True, -90, 0)
-
c2 = draw.Circle(0, 0, 10)
-
# See for supported attributes:
-
# https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateMotion
-
c2.appendAnim(draw.AnimateMotion(ellipse, '3s',
-
repeatCount='indefinite'))
-
# See for supported attributes:
-
# https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateTransform
-
c2.appendAnim(draw.AnimateTransform('scale', '3s', '1,2;2,1;1,2;2,1;1,2',
-
repeatCount='indefinite'))
-
d.saveSvg('/Users/cduck/Downloads/animated.svg') # Save to file
-
d # Display in Jupyter notebook
-
[](https://github.com/cduck/drawSvg/blob/master/examples/animated.svg)
···
[](https://github.com/cduck/drawSvg/blob/master/examples/example4.svg)
+
### Animation with the SVG Animate Tag
+
d = draw.Drawing(200, 200, origin='center')
+
# Animate the position and color of circle
+
c = draw.Circle(0, 0, 20, fill='red')
+
# See for supported attributes:
+
# https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animate
+
c.appendAnim(draw.Animate('cy', '6s', '-80;80;-80',
+
repeatCount='indefinite'))
+
c.appendAnim(draw.Animate('cx', '6s', '0;80;0;-80;0',
+
repeatCount='indefinite'))
+
c.appendAnim(draw.Animate('fill', '6s', 'red;green;blue;yellow',
+
repeatCount='indefinite'))
+
# Animate a black circle around an ellipse
+
ellipse.A(90, 40, 360, True, True, 90, 0) # Ellipse path
+
ellipse.A(90, 40, 360, True, True, -90, 0)
+
c2 = draw.Circle(0, 0, 10)
+
# See for supported attributes:
+
# https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateMotion
+
c2.appendAnim(draw.AnimateMotion(ellipse, '3s',
+
repeatCount='indefinite'))
+
# See for supported attributes:
+
# https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateTransform
+
c2.appendAnim(draw.AnimateTransform('scale', '3s', '1,2;2,1;1,2;2,1;1,2',
+
repeatCount='indefinite'))
+
d.saveSvg('animated.svg') # Save to file
+
d # Display in Jupyter notebook
+
[](https://github.com/cduck/drawSvg/blob/master/examples/animated.svg)
···

+
### Animation with Python
···
