Gallery
From Maxima CAS Wiki
Don't hesitate to contribute your valuable images.
Informations about improving images or source code are wellcome.
Click on image to see description and source code
Contents |
Raster images
2D images
Julia set and external rays landing on parabolic period 2-cycle
2D view of Julia set ( black points) and its critical orbit ( red points)
2D view of forward orbit of critical point of complex quadratic polynomial
Centers of 983 hyperbolic components of Mandelbrot set with respect to complex quadratic polynomial for period 1-10
Apollonian gasket
3D images
Forward orbit of critical point of complex quadratic polynomial tending to weakly attracting fixed point.
3D view of 2D Julia set where third dimension is distribution of points of inverse orbit of crtitical point for complex quadratic polynomial.
Vector images
Topologicla model of Mandelbrot set ( here is png version because now it is not allowed to upload svg files)
How to make vector svg images instead of rasterpng files ?
Notes
- it is not permitted to upload svg images to Maxima wiki now (:-(
- svg images which are made of lot of elements need a long time to load ( raster version is loade much quicker )
Direct method
Here svg file is directly created
First example
cmWidth:10; cmHeight:10; iWidth:800; iHeight:600; radius:200; center_x:400; center_y:300; f_name:"a.svg"; f : openw (f_name); printf(f, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>~%"); printf(f, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"~%\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">~%"); printf(f,"<svg width=\"~d cm\" height=\"~d cm\" viewBox=\"0 0 ~d ~d\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">~%", cmWidth,cmHeight,iWidth,iHeight); printf(f,"<circle cx=\"~f\" cy=\"~f\" r=\"~f\" fill=\"white\" stroke=\"black\" stroke-width=\"2\"/>~%",center_x,center_y,radius); printf(f,"</svg>~%"); close (f);
Above code draws circle usung circle svg command.
Basic svg functions
BeginSVG(file_name,cm_width,cm_height,i_width,i_height):= block( destination : openw (file_name), printf(destination, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>~%"), printf(destination, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"~%\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">~%"), printf(destination,"<svg width=\"~dcm\" height=\"~dcm\" viewBox=\"0 0 ~d ~d\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">~%", cm_width,cm_height,i_width,i_height), return(destination) ); CircleSVG(dest,center_x,center_y,_radius,_strokeWidth):= printf(dest,"<circle cx=\"~f\" cy=\"~f\" r=\"~f\" fill=\"white\" stroke=\"black\" stroke-width=\"~f\"/>~%", center_x,center_y,_radius,_strokeWidth); EndSVG(destination):= ( printf(destination,"</svg>~%"), close (destination) );
And example of use :
f:BeginSVG("a.svg",30,20,800,600);
circleSVG(f,100,100,50,1);
EndSVG(f);
It maybe usefull for drawing images made of circles, like :
- circle packings
- Kleinian groups
Using Gnuplot
Gnuplot creates svg not correctly:
- one must add manually </svg> at the end of the svg file
- if you want to draw circles svg image does not use circle element, but path. It maybe important when one have to draw many ( like thousands) of circles.
Using Gnuplot thru Plot package
Functions plot2d, plot3d and contour_plot arre defind in plot package ( file plot.lisp ), which is automaticaly loaded.
set_plot_option([plot_format, gnuplot]); set_plot_option([nticks, 80]); set_plot_option([gnuplot_term, svg]); set_plot_option([gnuplot_out_file, "circle.svg"]); plot2d ([parametric, cos(t), sin(t),[t,-%pi,%pi]])$
Here is sample image.
Using Gnuplot thru Draw package
"This terminal is not directly supported by draw, but you can use the 'user_preamble' option to force output in svg format." <ref>Mario Rodriguez proposition in discussion about discrete dynamical system on the Maxima mailing list</ref>
Here is an example:
load(draw); draw2d(explicit(exp(x)-1,x,-1,1),user_preamble=["set terminal svg","set out 'mysvg.svg'"]);
Here is png image and its svg version.
See also
- Introduction to Dynamical Systems: A Hands-on Approach with Maxima. A free book by Jaime E. Villate, ISBN 972-99396-0-8, Porto, Portugal, 2007.
- Images made with draw package ( interface to Gnuplot)
- Wiki Commons Category : Created with Maxima software
- 49.1 Introduction to dynamics package
- Package fractals repository
Notes and references
<references/>
