KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LogPlot.m
Go to the documentation of this file.
1 
2 
3 /* (Autoinserted by mtoc++)
4  * This source code has been filtered by the mtoc++ executable,
5  * which generates code that can be processed by the doxygen documentation tool.
6  *
7  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
8  * Except for the comments, the function bodies of your M-file functions are untouched.
9  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
10  * attached source files that are highly readable by humans.
11  *
12  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
13  * the correct locations in the source code browser.
14  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
15  */
16 
17 class LogPlot {
39  public: /* ( Static ) */
40 
42  p = surf(h,X,Y,Z," FaceColor "," interp "," EdgeColor "," k ",varargin[:]);
43  }
61  p = surfc(h,X,Y,Z," FaceColor "," interp "," EdgeColor "," k ",varargin[:]);
62  }
80 
81  /* Create meshgrid if not already existing */
82  if isvector(X) && isvector(Y)
83  [X,Y] = meshgrid(X,Y);
84  end
85  iszero = Z == 0;
86  Z(iszero) = .5*min(Z(:));
87  Z = log10(Z);
88  p = LogPlot.nicesurf(h,X,Y,Z,varargin[:]);
89  LogPlot.postprocess(h);
90  }
108 
109  /* Create meshgrid if not already existing */
110  if isvector(X) && isvector(Y)
111  [X,Y] = meshgrid(X,Y);
112  end
113  iszero = Z == 0;
114  Z(iszero) = .5*min(Z(:));
115  Z = log10(Z);
116  p = LogPlot.nicesurfc(h,X,Y,Z,varargin[:]);
117  LogPlot.postprocess(h);
118  }
136  static function handlep = logtrisurf(handle h,tri,rowvec<double> x,rowvec<double> y,rowvec<double> z,varargin) {
137  z = log10(z);
138  p = trisurf(tri, x, y, z," Parent ",h," FaceColor "," interp "," EdgeColor "," k ",varargin[:]);
139  LogPlot.postprocess(h);
140  }
158  static function handlep = cleverPlot(handle ax,rowvec<double> x,rowvec<double> y,varargin) {
159  if any(y(:)) < 0 || all(max(y)./min(y) < 50)
160  pfun = @plot;
161  else
162  /* As soon as one plot varies over more that two orders of magnitude,
163  * use log Y scale */
164  set(ax," YScale "," log ");
165  pfun = @semilogy;
166  end
167  p = pfun(ax,x,y,varargin[:]);
168  }
184  private: /* ( Static ) */
185 
186  static function postprocess(h) {
187  if all(strcmp(" auto ",[get(h," XLimMode "),get(h," YLimMode "),get(h," ZLimMode ")]))
188  axis(h," tight ");
189  end
190  lbl = arrayfun(@(e)sprintf(" %1.1e ",e),10.^get(h," ZTick ")," Unif ",false);
191  set(h," ZTickLabel ",lbl," ZTickMode "," manual ");
192  }
193 
194 
195 };
196 
LogPlot: Class with static functions for logarithmic plotting.
Definition: LogPlot.m:17
static function handle p = nicesurfc(handle h,matrix< double > X,matrix< double > Y,matrix< double > Z, varargin)
Creates a nice surface plot including a contour with the given data.
Definition: LogPlot.m:60
static function handle p = logtrisurf(handle h, tri,rowvec< double > x,rowvec< double > y,rowvec< double > z, varargin)
Creates a surface plot from a 2D triangulation in a logarithmic scale.
Definition: LogPlot.m:136
Matlab's base handle class (documentation generation substitute)
static function handle p = logsurf(handle h,matrix< double > X,matrix< double > Y,matrix< double > Z, varargin)
Creates a nice surface plot in a logarithmic scale with the given data.
Definition: LogPlot.m:79
static function handle p = cleverPlot(handle ax,rowvec< double > x,rowvec< double > y, varargin)
Calls corresponding plot routines depending on the scale of data.
Definition: LogPlot.m:158
A variable number of input arguments.
#define X(i, j)
static function handle p = logsurfc(handle h,matrix< double > X,matrix< double > Y,matrix< double > Z, varargin)
Creates a nice surface plot including a contour with the given data in a logarithmic scale...
Definition: LogPlot.m:107
Speed test * all(1:3)
static function handle p = nicesurf(handle h,matrix< double > X,matrix< double > Y,matrix< double > Z, varargin)
Creates a nice surface plot with the given data.
Definition: LogPlot.m:41
#define Y(i, j)