October 25, 2014, Saturday, 297

Graph/Plot Creation

From OLEG

(Difference between revisions)
Jump to: navigation, search
(Graph/Plot Creation Best Practice)
(Graph/Plot Creation Best Practice)
Line 16: Line 16:
## 1.5 to 2.0 pt line width for data, and marker-size varies according to type of marker.
## 1.5 to 2.0 pt line width for data, and marker-size varies according to type of marker.
# By default, simplify all data color and style formatting as much as possible (or that clearly makes the point).
# By default, simplify all data color and style formatting as much as possible (or that clearly makes the point).
-
# Suggest to use the following custom Matlab ".m" function before executing a plotting command:
+
# Suggest to use the following custom Matlab function before executing a plotting command (create a new script "formatting_pre.m" and copy/paste the below into it; then just run "formatting_pre" before your plot command):
-
LINK TO .M FILE
+
 
 +
function[] = formatting_pre(input1)
 +
%------
 +
% syntax: formatting_pre( plot_size_in_inches )
 +
%------
 +
% Will automatically set the current figure to have the proper plot and
 +
% pagesize set by the optional "plot_size_in_inches". By default, if no
 +
% argument is provided, then the plotsize will be 3x2 inches.
 +
 +
%--handling the default or input parameters
 +
if nargin==0, WHsize = [3 2];
 +
elseif size(input1)~=[1 2], error('Input argument is not 1x2 vector (eg, [3 2]) in inches');
 +
else, WHsize = input1; end
 +
 +
%--formatting for overall aspects
 +
set(gca,'units','inches','position',[0.6 0.5 WHsize]);
 +
set(gcf,'paperPosition',[0.25 0.25 WHsize*1.5])
 +
%--formatting for text aspects
 +
set(gca,'fontname','Arial','fontsize',10)
 +
set(gca,'linewidth',1);
 +
end
 +
 
<br>
<br>

Revision as of 15:18, 28 June 2011

Common Challenges

  • destination differences for technical artwork, likely requiring varying resolution/font scaling
  • data quantity often limited in some way by figure or computing software
  • compatability questions (doc/latex/ppt/wiki/etc vs jpg/eps/pdf/other)
  • assuring consistency (within doc, within student, within OLEG)
  • smartly handling color


Graph/Plot Creation Best Practice

  1. Use a proper graphing program (eg, MATLAB, etc) that is capable of precise parameter settings.
  2. By default, it is important to try to originally create the graph and font sizes as the destination (eg, journal manuscript, dissertation, presentation, etc) requires. Normally, if a graph is properly prepared for a two-column manuscript, it is also very appropriate (directly transferrable) for presentation slides and practically all other destinations.
  3. By default, it is wise to choose a plotbox width (excluding axis labeling) of 3 inches, since most journals use a two-column format, with a single-column width of close to 3.4 inches wide.
  4. By default, it is good to use
    1. 1 pt linewidth for all plot lines,
    2. 10 pt fontsize for axis numbers and labels,
    3. 1.5 to 2.0 pt line width for data, and marker-size varies according to type of marker.
  5. By default, simplify all data color and style formatting as much as possible (or that clearly makes the point).
  6. Suggest to use the following custom Matlab function before executing a plotting command (create a new script "formatting_pre.m" and copy/paste the below into it; then just run "formatting_pre" before your plot command):
function[] = formatting_pre(input1)
%------
% syntax:  formatting_pre( plot_size_in_inches )
%------
%  Will automatically set the current figure to have the proper plot and
%  pagesize set by the optional "plot_size_in_inches".  By default, if no
%  argument is provided, then the plotsize will be 3x2 inches.

%--handling the default or input parameters
if nargin==0, WHsize = [3 2];
elseif size(input1)~=[1 2], error('Input argument is not 1x2 vector (eg, [3 2]) in inches');
else, WHsize = input1;  end

%--formatting for overall aspects
set(gca,'units','inches','position',[0.6 0.5 WHsize]);
set(gcf,'paperPosition',[0.25 0.25 WHsize*1.5])
%--formatting for text aspects
set(gca,'fontname','Arial','fontsize',10)
set(gca,'linewidth',1);
end