# HG changeset patch # User jwe # Date 1191646476 0 # Node ID c962cc09067a2b672cd459d83e6fd8009f974977 # Parent 33f20a41aeea0a07725d6b4c05c4aedca057536c [project @ 2007-10-06 04:54:36 by jwe] diff -r 33f20a41aeea -r c962cc09067a scripts/ChangeLog --- a/scripts/ChangeLog Sat Oct 06 04:31:18 2007 +0000 +++ b/scripts/ChangeLog Sat Oct 06 04:54:36 2007 +0000 @@ -1,4 +1,9 @@ -2007-10-05 Ben Abbott +2007-10-06 Francesco Potorti` + + * plot/print.m: Handle svg output type. Accept new -S option to + specify size for PNG and SVG output types. + +2007-10-05 Ben Abbott * polynomial/mpoles.m: New function. * polynomial/residue.m: Modified to behave in reciprocal diff -r 33f20a41aeea -r c962cc09067a scripts/plot/print.m --- a/scripts/plot/print.m Sat Oct 06 04:31:18 2007 +0000 +++ b/scripts/plot/print.m Sat Oct 06 04:54:36 2007 +0000 @@ -68,20 +68,22 @@ ## @item cdr ## @itemx corel ## CorelDraw +## @item dxf +## AutoCAD +## @item emf +## Microsoft Enhanced Metafile +## @item fig +## XFig ## @item hpgl ## HP plotter language -## @item fig -## XFig -## @item dxf -## AutoCAD ## @item mf ## Metafont ## @item png ## Portable network graphics ## @item pbm ## PBMplus -## @item emf -## Microsoft Enhanced Metafile +## @item svg +## Scalable vector graphics ## @end table ## ## Other devices are supported by "convert" from ImageMagick. Type @@ -90,6 +92,11 @@ ## If the device is omitted, it is inferred from the file extension, ## or if there is no filename it is sent to the printer as postscript. ## +## @itemx -S@var{xsize},@var{ysize} +## Plot size in pixels for PNG and SVG. If using the command form of +## the print function, you must quote the @var{xsize},@var{ysize} +## option. For example, by writing @code{"-S640,480"}. +## ## @item -F@var{fontname} ## @itemx -F@var{fontname}:@var{size} ## @itemx -F:@var{size} @@ -115,6 +122,7 @@ force_solid = 0; # 0=default, -1=dashed, +1=solid fontsize = ""; font = ""; + size = ""; name = ""; devopt = ""; printer = ""; @@ -153,6 +161,8 @@ else font = arg(3:length(arg)); endif + elseif (length (arg) > 2 && arg(1:2) == "-S") + size = arg(3:length(arg)); elseif (length (arg) >= 1 && arg(1) == "-") error ("print: unknown option `%s'", arg); elseif (length (arg) > 0) @@ -197,7 +207,7 @@ endif ## check if we have to use convert - dev_list = {"aifm", "corel", "fig", "png", "pbm", "dxf", "mf", ... + dev_list = {"aifm", "corel", "fig", "png", "pbm", "dxf", "mf", "svg", ... "hpgl", "ps", "ps2", "psc", "psc2", "eps", "eps2", ... "epsc", "epsc2", "emf", "pstex", "pslatex", ... "epslatex", "epslatexstandalone"}; @@ -331,11 +341,25 @@ ##eval (sprintf ("__gnuplot_set__ term %s mono medium", dev)); ##endif - new_terminal = "png large"; + if (isempty (size)) + options = " large"; + else + options = strcat (" size ", size); + endif + new_terminal = strcat ("png", options); elseif (strcmp (dev, "dxf") || strcmp (dev, "mf") || strcmp (dev, "hpgl")) ## AutoCad DXF, METAFONT, HPGL new_terminal = dev; + + elseif (strcmp (dev, "svg")) + ## SVG + options = ""; + if (! isempty (size)) + options = strcat (" size ", size); + endif + new_terminal = strcat ("svg", options); + endif if (debug)