Contents     Functions         Previous Next     PDF Index

comgui,cingui

Purpose

General utilities for graphical user interfaces.

Syntax

 comgui('Command', ...)
 cingui('Command', ...)

comgui is an open source function that the user is expected to call directly while cingui is closed source and called internally by SDT.

ImWrite, ...

ImwriteFileName.ext does a clean print of the current figure. It can be called as a command with the options detailed below. The same command can be used to prepare single or multiple image capture, it is then called using comgui('ImWrite',gf,RO) with options stored in the RO structure. For details on the structure, and for multi-image capture specific options, see iicom ImWrite.

FitLabel

comgui('fitlabel') attempts to replace axes of the current figure so that xlabel, ylabel, ... are not cropped.

objSet

Uniform formatting of figures is often a necessity. The cingui('objSet',h,Prop) is the SDT utility to store reusable formatting instructions. Prop is a cell array of tags and values classical in MATLAB properties with possible modifications.

For the property value, a replacement mechanism is provided if the value is a string starting with @.

 figure(1);t=linspace(0,2*pi);h=plot(t,[1:3]'*sin(t));
 cingui('objset',1, ...       % Handle to the object to modify
   {'','@Rep{SmallWide}', ... % Predefined figure type
    '@line','@setlines(''marker'')'}) % Line sequencing

def.Legend

The def.Legend field is used to control dynamic generation of text associated with a given display. It is stored using the classical form of property/value pairs stored in a cell array, whose access can be manual or more robustly done with sdsetprop.

Accepted properties any text property (see doc text) and the specific, case ensitive, properties

 [model,def]=hexa8('testeig');cf=feplot(model);
 def.Legend={'set','legend -corner .1 .9 -reset', ... % Init
  'string',{'\it MyCube';'$title'}, ... % The legend strings
  'FontSize',12} % Other test properties
 def=sdsetprop(def,'Legend','ImWrite',{sdtdef('tempdir'),'FigRoot', ...
  2,1, ... % insert second and first legend lines in file name
  '.png'}) % Generate file as png
 cf.def=def;
 comgui('imFTitle') % Display the file name used comgui('imwrite')

©1991-2012 by SDTools
Previous Up Next