comparison scripts/plot/util/print.m @ 27343:2c9795736894

print.m: Allow "-svgconvert" to be used for EPS output (bug #52764) * print.m: Rework documentation about the -svgconvert option, PS, EPS and PDF formats. Totally remove transparency from grid lines before printing to PostScript outputs. * __opengl_print__.m: Don't restrict teh -svgconvert option to non-PostScript outputs. * __print_parse_opts__.m: Provide a Ghostscript device name for EPS when using -svgconvert.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Wed, 12 Jun 2019 21:58:16 +0200
parents 0a62d9a6aa2d
children 8ff5628d8b55
comparison
equal deleted inserted replaced
27342:254d6e33a1d0 27343:2c9795736894
112 ## @item -opengl 112 ## @item -opengl
113 ## @itemx -painters 113 ## @itemx -painters
114 ## Specifies whether the opengl (pixel-based) or painters (vector-based) 114 ## Specifies whether the opengl (pixel-based) or painters (vector-based)
115 ## renderer is used. This is equivalent to changing the figure's 115 ## renderer is used. This is equivalent to changing the figure's
116 ## @qcode{"Renderer"} property. When the figure @code{RendererMode} property 116 ## @qcode{"Renderer"} property. When the figure @code{RendererMode} property
117 ## is @qcode{"auto"} Octave will use the @qcode{"opengl"} renderer for raster 117 ## is @qcode{"auto"} (the default) Octave will use the @qcode{"opengl"} renderer
118 ## formats (e.g., JPEG) and @qcode{"painters"} for vector formats (e.g., PDF)@. 118 ## for raster formats (e.g., JPEG) and @qcode{"painters"} for vector formats
119 ## (e.g., PDF).
119 ## Those options are only supported for the "qt" graphics tookit. 120 ## Those options are only supported for the "qt" graphics tookit.
120 ## 121 ##
121 ## @item -svgconvert 122 ## @item -svgconvert
122 ## For OpenGL-based graphic toolkits, this enables a different backend 123 ## When using the -painters renderer, this enables a different backend
123 ## toolchain with enhanced characteristics. The toolchain adds support for 124 ## toolchain with enhanced characteristics:
124 ## printing arbitrary characters and fonts in PDF outputs; it avoids some 125 ##
125 ## anti-aliasing artifacts in the rendering of patch and surface objects 126 ## @table @asis
126 ## (particularly for 2-D scenes); and it supports transparency of line, patch, 127 ## @item Font handling:
127 ## and surface objects. 128 ## The actual font is embedded in the output file which allows for printing
128 ## 129 ## arbitrary characters and fonts in all vector formats.
129 ## This option only affects PDF outputs, unless it is combined with 130 ## @item Output Simplification:
130 ## @option{-painters} option, in which case raster outputs are also affected. 131 ## By default, the @code{-painters} renders patch and surface objects
132 ## using assemblies of triangles. This may lead to anti-aliasing
133 ## artifacts when viewing the file. The @code{-svgconvert} option reconstructs
134 ## polygons in order to avoid those artifacts (particularly for 2-D figures).
135 ## @item Transparency:
136 ## Allows for printing transparent graphics objects in PDF format.
137 ## For PostScript formats the presence of any transparent object will cause the
138 ## output to be rasterized.
139 ## @end table
131 ## 140 ##
132 ## Caution: @option{-svgconvert} may lead to inaccurate rendering of image 141 ## Caution: @option{-svgconvert} may lead to inaccurate rendering of image
133 ## objects. 142 ## objects.
134 ## 143 ##
135 ## @item -portrait 144 ## @item -portrait
225 ## the Gnuplot toolkit): 234 ## the Gnuplot toolkit):
226 ## 235 ##
227 ## Vector Formats 236 ## Vector Formats
228 ## 237 ##
229 ## @table @code 238 ## @table @code
239 ## @item svg
240 ## Scalable Vector Graphics.
241 ##
230 ## @item pdf 242 ## @item pdf
231 ## @itemx pdfcrop 243 ## @itemx pdfcrop
232 ## Portable Document Format. The @code{pdfcrop} device removes the default 244 ## Portable Document Format. The @code{pdf} device formats the figure for
233 ## surrounding page. 245 ## printing on paper. The size of the surrounding page and the position of the
234 ## 246 ## figure inside the page are defined by the
235 ## The OpenGL-based graphics toolkits have limited support for text. 247 ## @ref{XREFfigurepaperorientation,, paper* figure properties}.
248 ##
249 ## Use @code{pdfcrop} if you don't want the surrounding page.
250 ##
251 ## By default, PDF inherits the same limitations as PostScript.
252 ## For an enhanced output with complete text support and basic transparency,
253 ## use the @option{-svgconvert} option.
254 ##
255 ## @item eps(2)
256 ## @itemx epsc(2)
257 ## Encapsulated PostScript (level 1 and 2, mono and color).
258 ##
259 ## The OpenGL-based graphics toolkits always generate PostScript level 3.0.
260 ## They have limited support for text unless using the @code{-svgconvert}
261 ## option.
236 ## Limitations include using only ASCII characters (e.g., no Greek letters) 262 ## Limitations include using only ASCII characters (e.g., no Greek letters)
237 ## and support for just three base PostScript fonts: Helvetica (the default), 263 ## and support for just three base PostScript fonts: Helvetica (the default),
238 ## Times, or Courier. Any other font will be replaced by Helvetica. 264 ## Times, or Courier. Any other font will be replaced by Helvetica.
239 ## 265 ##
240 ## For an enhanced output with complete text support and basic transparency, 266 ## @item ps(2)
241 ## use the @option{-svgconvert} option. 267 ## @itemx psc(2)
242 ## 268 ## Same as @code{eps} except that the figure is formated for printing on
243 ## @item ps 269 ## paper. The size of the surrounding page and position of the figure inside
244 ## @itemx ps2 270 ## the page are defined by the
245 ## @itemx psc 271 ## @ref{XREFfigurepaperorientation,, paper* figure properties}.
246 ## @itemx psc2
247 ## PostScript (level 1 and 2, mono and color). The OpenGL-based graphics
248 ## toolkits always generate PostScript level 3.0 and have limited support for
249 ## text.
250 ##
251 ## @item eps
252 ## @itemx eps2
253 ## @itemx epsc
254 ## @itemx epsc2
255 ## Encapsulated PostScript (level 1 and 2, mono and color). The
256 ## OpenGL-based toolkits always generate PostScript level 3.0 and have
257 ## limited support for text.
258 ## 272 ##
259 ## @item pslatex 273 ## @item pslatex
260 ## @itemx epslatex 274 ## @itemx epslatex
261 ## @itemx pdflatex 275 ## @itemx pdflatex
262 ## @itemx pslatexstandalone 276 ## @itemx pslatexstandalone
291 ## variants generate a @LaTeX{} file, @file{@var{filename}.tex}, for the text 305 ## variants generate a @LaTeX{} file, @file{@var{filename}.tex}, for the text
292 ## portions of a plot, and an image file, @file{@var{filename}.(eps|pdf)}, for 306 ## portions of a plot, and an image file, @file{@var{filename}.(eps|pdf)}, for
293 ## the graph portion of the plot. The @samp{standalone} variants behave as 307 ## the graph portion of the plot. The @samp{standalone} variants behave as
294 ## described for @samp{epslatexstandalone} above. 308 ## described for @samp{epslatexstandalone} above.
295 ## 309 ##
296 ## @item svg
297 ## Scalable Vector Graphics
298 ##
299 ## @item canvas* 310 ## @item canvas*
300 ## Javascript-based drawing on an HTML5 canvas viewable in a web browser. 311 ## Javascript-based drawing on an HTML5 canvas viewable in a web browser.
301 ## 312 ##
302 ## @item emf 313 ## @item emf
303 ## @itemx meta 314 ## @itemx meta
513 props(end).name = "gridcolor"; 524 props(end).name = "gridcolor";
514 props(end).value = {get(hax(n), "gridcolor")}; 525 props(end).value = {get(hax(n), "gridcolor")};
515 set (hax(n), "gridcolor", [0.85 0.85 0.85]); 526 set (hax(n), "gridcolor", [0.85 0.85 0.85]);
516 nfig += 2; 527 nfig += 2;
517 endif 528 endif
529 if (strcmp (get (hax(n), "gridalphamode"), "auto"))
530 props(end+1).h = hax(n);
531 props(end).name = "gridalphamode";
532 props(end).value = {"auto"};
533 props(end+1).h = hax(n);
534 props(end).name = "gridalpha";
535 props(end).value = {get(hax(n), "gridalpha")};
536 set (hax(n), "gridalpha", 1);
537 nfig += 2;
538 endif
518 539
519 if (strcmp (get (hax(n), "minorgridcolormode"), "auto")) 540 if (strcmp (get (hax(n), "minorgridcolormode"), "auto"))
520 props(end+1).h = hax(n); 541 props(end+1).h = hax(n);
521 props(end).name = "minorgridcolormode"; 542 props(end).name = "minorgridcolormode";
522 props(end).value = {"auto"}; 543 props(end).value = {"auto"};
523 props(end+1).h = hax(n); 544 props(end+1).h = hax(n);
524 props(end).name = "minorgridcolor"; 545 props(end).name = "minorgridcolor";
525 props(end).value = {get(hax(n), "minorgridcolor")}; 546 props(end).value = {get(hax(n), "minorgridcolor")};
526 set (hax(n), "minorgridcolor", [0.75 0.75 0.75]); 547 set (hax(n), "minorgridcolor", [0.75 0.75 0.75]);
548 nfig += 2;
549 endif
550 if (strcmp (get (hax(n), "minorgridalphamode"), "auto"))
551 props(end+1).h = hax(n);
552 props(end).name = "minorgridalphamode";
553 props(end).value = {"auto"};
554 props(end+1).h = hax(n);
555 props(end).name = "minorgridalpha";
556 props(end).value = {get(hax(n), "minorgridalpha")};
557 set (hax(n), "minorgridalpha", 1);
527 nfig += 2; 558 nfig += 2;
528 endif 559 endif
529 endfor 560 endfor
530 endif 561 endif
531 562