Figure Print Preparation Tool: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
;[[File: setplot.m]]
[[Matlab tools|Back to Matlab Tools]]
 
 
;Files:
Note: Wikipedia automatically changes the first letter of a filename to uppercase. To avoid warnings in Matlab, save the file in lowercase.
 
[[File: setplot.m]]
 


;Description: A tool to set the margins, papersize, align labels, etc...
;Description: A tool to set the margins, papersize, align labels, etc...
   
    Usage:  setplot(fig, figsize, {top, bottom, rows, left, right, cols}, fontsize, fontname) 
            to use defaults on current figure, run without arguments               
    Inputs:  fig = figure handle 
            figsize = [figwidth figheight] in cm 
                          *1      *2  (see figure below) 
            margins = {top, bottom, rows, left, right, cols} in cm 
                        *m1  *m2    *m3  *m4  *m5    *m6  (see figure below)
                        note: leave margin empty [] to use optimal values
                              e.g. {[],[],[],1.5} only sets left margin to 1.5 cm   
            fontsize = size of the font               
            fontname = type of fontfile: 
            _____________________________________________  _ _ _ _ _ __ 
            |        __________        __________        | _ _ _*m1  ^ 
            |  y  |          |      |          |      |            | 
            |  l  | subplot1 |      | subplot2 |      |            . 
            |  b  |          |      |          |      |            | 
            |  l  |__________|      |__________|      | _ _ _      .                                                     
            |                                            |      *m3  | 
            |        __________        __________        | _ _ _    *2 
            |  y  |          |      |          |      |            | 
            |  l  | subplot3 |      | subplot4 |      |            . 
            |  b  |          |      |          |      |            | 
            |  l  |__________|      |__________|      | _ _ _      . 
            |          xlabel            xlabel          |      *m2  | 
            |_____________________________________________| _ _ _ _ _ _v_ 
           
            |      |          |      |          |      | 
            |<-*m4->|          |<-*m6->|          |<-*m5->| 
            |<-------------- *1 ------------------------->| 
         
    Outputs: none 


;Usage:
Especially useful in combination with the figure saving tool (saver.m)
  setplot(fig, figsize, margins, fontsize, fontname)
  default:
  setplot(gcf, [10 10], [0.25 0.9 0.5 1.2 1.2 0.75], 10, 'Times');
  parameters:
      fig = figure handle
            current figure is default
      figsize = [figwidth figheight] in cm
                    *1      *2  (see figure below)
                [10 10] is default
      margins = [top bottom rows left right cols] in cm
                  *m1  *m2  *m3  *m4  *m5  *m6  (see figure below)
                default see below
      fontsize = size of the font
                10 is default           
      fontname = type of fontfile:
                'Times New Roman' is default
            _____________________________________________  _ _ _ _ _ __
          |        __________        __________        | _ _ _*m1  ^
          |  y  |          |      |          |      |            |
          |  l  | subplot1 |      | subplot2 |      |            .
          |  b  |          |      |          |      |            |
          |  l  |__________|      |__________|      | _ _ _      .                                                   
          |                                            |      *m3  |
          |        __________        __________        | _ _ _    *2
          |  y  |          |      |          |      |            |
          |  l  | subplot3 |      | subplot4 |      |            .
          |  b  |          |      |          |      |            |
          |  l  |__________|      |__________|      | _ _ _      .
          |          xlabel            xlabel          |      *m2  |
          |_____________________________________________| _ _ _ _ _ _v_
       
          |      |          |      |          |      |
          |<-*m4->|          |<-*m6->|          |<-*m5->|
          |<-------------- *1 ------------------------->|


Especially useful in combination with the figure saving tool (saver.m)


;Author: Rob Hoogendijk
;Author: Rob Hoogendijk

Latest revision as of 14:48, 4 August 2011

Back to Matlab Tools


Files

Note: Wikipedia automatically changes the first letter of a filename to uppercase. To avoid warnings in Matlab, save the file in lowercase.

File:Setplot.m


Description
A tool to set the margins, papersize, align labels, etc...
   Usage:   setplot(fig, figsize, {top, bottom, rows, left, right, cols}, fontsize, fontname)  
            to use defaults on current figure, run without arguments                

   Inputs:  fig = figure handle   
            figsize = [figwidth figheight] in cm  
                          *1       *2  (see figure below)  
            margins = {top, bottom, rows, left, right, cols} in cm  
                       *m1  *m2     *m3   *m4   *m5    *m6  (see figure below)
                       note: leave margin empty [] to use optimal values
                             e.g. {[],[],[],1.5} only sets left margin to 1.5 cm    
            fontsize = size of the font                
            fontname = type of fontfile:  
            _____________________________________________  _ _ _ _ _ __  
           |        __________         __________        | _ _ _*m1   ^  
           |   y   |          |       |          |       |            |  
           |   l   | subplot1 |       | subplot2 |       |            .  
           |   b   |          |       |          |       |            |   
           |   l   |__________|       |__________|       | _ _ _      .                                                      
           |                                             |      *m3   |  
           |        __________         __________        | _ _ _     *2  
           |   y   |          |       |          |       |            |   
           |   l   | subplot3 |       | subplot4 |       |            .  
           |   b   |          |       |          |       |            |   
           |   l   |__________|       |__________|       | _ _ _      .   
           |          xlabel             xlabel          |      *m2   |   
           |_____________________________________________| _ _ _ _ _ _v_   
           
           |       |          |       |          |       |  
           |<-*m4->|          |<-*m6->|          |<-*m5->|  
           |<-------------- *1 ------------------------->|  
          
   Outputs: none   

Especially useful in combination with the figure saving tool (saver.m)


Author
Rob Hoogendijk