| Description |
ConvertPlot4Publication - This function formats figures and outputs files for a publication
This function formats a figure in a way that they are ready for a
publication, i.e. width and height of the figure, textsize, textfont, alignment of
subplots and backcolor and finally saves this figure in various formats (such as
MATLAB .fig, PDF, EPS, PNG, or PSFrag).
You can use this function to save all your figures which you might later
want to use for a publications. This way all your plots will be readily
available in different output formats and consistent formatting.
Syntax: ConvertPlot4Publication(filename,varargin)
Inputs:
filename (Required) - A string containting the name of the output files.
OPTIONS (Optional) - additional options are added in 'key' and 'value'
pairs
Key | Value
----------------------------------------------------------------------
'figure' | Figure to create the files from.
| default is gcf (current figure handle)
'height' | Height of final figure in inch. If no value is given
| the current figure width is taken.
'width' | Width of final figure in inch. Default is 3.45in
|(IEEE journal column width).
'backcolor' | [none] - Changes the backcolor of the figure. Default is
| none.
'samexaxes' | [on, off] - Defines if in case of stacked subplots
| only the x-axis from the lowest subplot is taken. Default is off.
| default is gcf (current figure handle)
'tickdir' | [in, out] - Direction of ticks.
'box' | [on, off] - Box around each plot is switched on or
| off.
'fontname' | Fontname used for each text element. Default value is 'Times New Roman'.
'fontsize' | Fontsize of each text element, including axis and legends. Default value is 10.
'linewidth' | Linewidth of each line. Default is 1.
'keepheights' | [on, off] - Do not change axes heights (default: off)
'keepvertical'| [on, off] - Do not rearange vertical position of the axes. (default: off)
'pdf' | [on, off] - PDF output (default: on)
'png' | [on, off] - PNG output (default: on)
'eps' | [on, off] - EPS output (default: on)
'psfrag' | [on, off] - Psfrag output (default: off)
'fig' | [on, off] - MATLAB .fig output (default: on)
Outputs:
none
Example:
%Generate some data
y1 = randn(1000,1);
y2 = randn(1000,1);
%Plot using two subplots
figure
subplot(2,1,1)
plot(y1)
ylabel('Y1')
subplot(2,1,2)
plot(y2)
ylabel('Y2')
xlabel('X')
%Export using the default options (output
ConvertPlot4Publication('testPlot')
%Export again, this time changing the font and using the same x-axis
ConvertPlot4Publication('testPlot2', 'fontsize', 8, 'fontname', 'Arial', 'samexaxes', 'on', 'eps', 'off')
Other m-files required: matlabfrag.m, export_fig.m (from matlabcentral)
Subfunctions: none
MAT-files required: none
Authors: Tobias Wartzek, Christoph Brueser |