This is an example of SvgPlot library. This example shows how to:
This is the example:
function plotExample1() % Open SVG file svgPlot=SvgPlotNew('plotExample1.svg'); % Sets line witdh and colors svgPlot=SvgPlotSetLineWidth(svgPlot, 4); svgPlot=SvgPlotSetForegroundColor(svgPlot, "blue"); svgPlot=SvgPlotSetBackgroundColor(svgPlot, "red"); % Draw some lines svgPlot=SvgPlotLine(svgPlot, 5, 5, 790, 300); % Poly-lines can be filled. Set true last parameter svgPlot=SvgPlotPolyLine(svgPlot, [5, 790, 300], [5, 300, 200], true); % Draw set of arrows for x=[0:30:360]*pi/180 svgPlot=SvgPlotArrow(svgPlot, 400, 300, 400+100*cos(x), 300+100*sin(x) ); % Print text "Arrow" svgPlot=SvgPlotText(svgPlot, 400+120*cos(x), 300+120*sin(x), "arrow" ); endfor % Draw circles and ellipses svgPlot=SvgPlotCircle(svgPlot, 400,300,100, false); svgPlot=SvgPlotEllipse(svgPlot, 400,300,100,200, false); % You can append images too % svgPlot=SvgPlotImage(svgPlot, 400, 300, 450, 350, './toys_section.png'); % Close SVG figure svgPlot=SvgPlotClose(svgPlot); % In QtOctave, you can show your figures. Uncomment next lines in QtOctave to show it. svgcanvasload(1, 'plotExample1.svg'); svgcanvassave(1, 800, 600, 'plotExample1.png'); endfunction
You must always open your SVG output file using SvgPlotNew function:
Build new SvgPlot object. SvgPlot object is a file with a plot in svg file format. This file can be loaded in QtOctave using svgcanvasload. fileName is name of file to save svg plot. width Width of plot in pixels. height Height of plot in pixels. Files opened with SvgPlotNew must be closed with SvgPlotClose. See also: SvgPlotClose
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
You must close your SVG output using SvgPlotClose function:
Close a SvgPlot object. See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Between SvgPlotNew and SvgPlotClose you can use:
Draw image file imageFile from (x0,y0) to (x1,y1). See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Plot polyline from (x,y) vectors. If fill_ok is true, poly-line is closed and filled. See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Draw an ellipse. If fill_ok is true, ellipse is filled. See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Draw text in (x,y). See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Set foreground color to svgPlot. See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Draw an ellipse. If fill_ok is true, ellipse is filled. See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Plot legent of plotData in (x,y). See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Build new SvgPlot object. SvgPlot object is a file with a plot in svg file format. This file can be loaded in QtOctave using svgcanvasload. fileName is name of file to save svg plot. width Width of plot in pixels. height Height of plot in pixels. Files opened with SvgPlotNew must be closed with SvgPlotClose. See also: SvgPlotClose
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Plot line from (x0,y0) to (x1,y1). See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Make a new plot of plotData in (x,y) coordinates and size (width, height). See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Plot arrow from (x0,y0) to (x1,y1). See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load
Close a SvgPlot object. See also: SvgPlotNew
See also: svgcanvasload, svgcanvassave, svgcanvas_delete_on_load