where to initialized property defaults?

Ben Abbott bpabbott at mac.com
Sat Jan 3 13:10:59 CST 2009


Michael/Shai, I've copied you specifically because of your work on the  
backend.

I've been investing some effort improving the gnuplot backend's  
support of root/figure/axes/text/etc properties.

One rather significant difficulty is where/how many of the default  
property values are to be set.

In graphics.h.in it is simple enough to initialize each index of  
vector associated with a property to a scalar value ... but what is to  
be done with properties like figure.papersize, figure.paperposition,  
root.screensize,

In my octaverc I set several property defaults. See below ...

if compare_versions (version, "3.1.0", ">=")
  set (0, "defaultaxesfontname", "Helvetica")
  set (0, "defaultaxesfontsize", 14)
  set (0, "defaultaxesinterpreter", "tex")
  set (0, "defaultaxesxtick", [0:0.2:1])
  set (0, "defaultaxesytick", [0:0.2:1])
  set (0, "defaultaxesztick", [0:0.2:1])
  set (0, "defaultaxesxtickmode", "auto")
  set (0, "defaultaxesytickmode", "auto")
  set (0, "defaultaxesztickmode", "auto")
  set (0, "defaultaxesactivepositionproperty", "outerposition")
  set (0, "defaultfigurepapertype", "usletter")
  set (0, "defaultfigurepapersize", [8.5 11])
  set (0, "defaultfigureposition", [440 314 560 420])
  set (0, "defaultfigurepaperposition", [0.25, 2.5, 8, 6])
  set (0, "screensize", [1, 1, 1440, 900])
  set (0, "screenpixelsperinch", 1440/14)
  edit editinplace true
  edit home .
endif

This should obviously be done at a lower level. Some of this is  
already being handled in gnuplot_drawnow.m.

I'm not sure where, or how, such defaults should be set in the  
sources, but having gnuplot_drawnow.m handle it is obviously bad  
practice.

Might someone be up to the task of taking this on, or offering  
guidance for the c++ deficient like myself? I don't see where in the  
sources xlim, ylim are set, so perhaps this is already in place for  
axes?

Ben


More information about the Octave-maintainers mailing list