# HG changeset patch # User Rik # Date 1606444762 28800 # Node ID f8afcf772ba0a6160bb69c4240ab02f60a885d68 # Parent c661350ee8dffc4e6378f5e788a7533c4c8b4bed __default_plot_options__.m: Document function and improve performance. * __default_plot_options__.m: Document function. Use single call to struct() which saves 30 milliseconds for me or -19% on execution time. diff -r c661350ee8df -r f8afcf772ba0 scripts/plot/util/__default_plot_options__.m --- a/scripts/plot/util/__default_plot_options__.m Thu Nov 26 18:25:42 2020 -0800 +++ b/scripts/plot/util/__default_plot_options__.m Thu Nov 26 18:39:22 2020 -0800 @@ -25,16 +25,17 @@ ## -*- texinfo -*- ## @deftypefn {} {@var{options} =} __default_plot_options__ () -## Undocumented internal function. +## Return a plot options structure @var{options} with default values +## for all fields. ## @end deftypefn function options = __default_plot_options__ () - options.key = ""; - options.color = []; - options.linestyle = []; - options.marker = []; - options.errorstyle = []; + options = struct ("key", "", + "color", [], + "linestyle", [], + "marker", [], + "errorstytle", []); endfunction