# HG changeset patch # User Rik # Date 1650577955 25200 # Node ID 8a8f82c0235e86b8ff8acd27b205e43797cf1024 # Parent abca9eac1ec9a6d6d80e4af6d708fd4cc5802f4e print.m: Add options "-image"/"-vector" for Matlab compatibility. These options duplicate the "-opengl" and "-painters" arguments and set the Renderer used by Octave for printing. The names more clearly show the intent and are Matlab compatible. * NEWS.8.md: Announce additional options. * print.m: Add new options to docstring. * __print_parse_opts__.m: Decode additional arguments and set "renderer" field appropriately. diff -r abca9eac1ec9 -r 8a8f82c0235e etc/NEWS.8.md --- a/etc/NEWS.8.md Thu Apr 21 13:53:27 2022 -0700 +++ b/etc/NEWS.8.md Thu Apr 21 14:52:35 2022 -0700 @@ -27,6 +27,9 @@ - `clock` now has an optional second output `ISDST` which indicates if Daylight Savings Time is in effect for the system's time zone. +- `print` now accepts option `-image` to specify the "opengl" renderer + and `-vector` to specify the "painters" renderer. + ### Alphabetical list of new functions added in Octave 8 diff -r abca9eac1ec9 -r 8a8f82c0235e scripts/plot/util/print.m --- a/scripts/plot/util/print.m Thu Apr 21 13:53:27 2022 -0700 +++ b/scripts/plot/util/print.m Thu Apr 21 14:52:35 2022 -0700 @@ -116,15 +116,15 @@ ## @end group ## @end example ## -## @item -opengl -## @itemx -painters -## Specifies whether the opengl (pixel-based) or painters (vector-based) -## renderer is used. This is equivalent to changing the figure's -## @qcode{"Renderer"} property. When the figure -## @nospell{@qcode{"RendererMode"}} property is @qcode{"auto"} (the default) -## Octave will use the @qcode{"opengl"} renderer for raster formats (e.g., -## JPEG) and @qcode{"painters"} for vector formats (e.g., PDF). Those options -## are only supported for the "qt" graphics toolkit. +## @item -image | -opengl +## @itemx -vector | -painters +## Specifies whether the pixel-based renderer (@env{-image} or @env{-opengl}) +## or vector-based renderer (@env{-vector} or @env{-painters}) is used. This +## is equivalent to changing the figure's @qcode{"Renderer"} property. When +## the figure @nospell{@qcode{"RendererMode"}} property is @qcode{"auto"} (the +## default) Octave will use the @qcode{"opengl"} renderer for raster formats +## (e.g., JPEG) and @qcode{"painters"} for vector formats (e.g., PDF)@. These +## options are only supported for the "qt" graphics toolkit. ## ## @item -svgconvert ## When using the @option{-painters} renderer, this enables a different diff -r abca9eac1ec9 -r 8a8f82c0235e scripts/plot/util/private/__print_parse_opts__.m --- a/scripts/plot/util/private/__print_parse_opts__.m Thu Apr 21 13:53:27 2022 -0700 +++ b/scripts/plot/util/private/__print_parse_opts__.m Thu Apr 21 14:52:35 2022 -0700 @@ -108,6 +108,10 @@ arg_st.force_solid = -1; elseif (any (strcmp (arg, {"-opengl", "-painters"}))) arg_st.renderer = arg(2:end); + elseif (strcmp (arg, "-image")) + arg_st.renderer = "opengl"; + elseif (strcmp (arg, "-vector")) + arg_st.renderer = "painters"; elseif (strcmp (arg, "-RGBImage")) arg_st.rgb_output = true; arg_st.renderer = "opengl";