How to set the plot in matlab to a specific size?

 Generally, I wish to plot a rather complex x-y plot (lots of overlapping curves) to an A3 format so: 

 

A4 210x297  
A3 = A4*2 = 420 x 297  
... - 10mm each side = 400 x 277 (size of desired plot window)

What is the easiest way to set the size of the plot so it fits that size when printed in PDF (or any other common output format)?  

NOTE:-


Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.    

Answers: 

As @LewisNorton explained, you need to set the Paper*** properties of the figure. Below is an example for producing a PDF file with dimensions 420 x 297 mm (A3 size), where the margins between the plot and the file borders are 10 mm each (top,bottom,left,right). 

 

%# centimeters units
X = 42.0;                  %# A3 paper size
Y = 29.7;                  %# A3 paper size
xMargin = 1;               %# left/right margins from page borders
yMargin = 1;               %# bottom/top margins from page borders
xSize = X - 2*xMargin;     %# figure size on paper (widht & hieght)
ySize = Y - 2*yMargin;     %# figure size on paper (widht & hieght)

%# create figure/axis
hFig = figure('Menubar','none');
plot([0 1 nan 0 1], [0 1 nan 1 0]), axis tight
set(gca, 'XTickLabel',[], 'YTickLabel',[], ...
    'Units','normalized', 'Position',[0 0 1 1]) 
SEE COMPLETE ANSWER CLICK THE LINK   
https://matlabhelpers.com/questions/how-to-set-the-plot-in-matlab-to-a-specific-size-.php

Comments

Popular posts from this blog

programmingshark

Why do I get a "Too many input arguments" error when not passing any?

Constructing piecewise symbolic function in Matlab