Need Help getting a 1:1 scale on a plot

117 views (last 30 days)
Manbir
Manbir on 29 Jul 2013
I'm plotting a polar function 2*cos(t)+4 specifically, and I need to print it out so that the units on the plot are inches in real life as I'm going to cut it out of something and need it to be that exact size. I'ma bit new to matlab and Im going to be doing a lot of these soon so what would be the best way to do this? or is there another program altogether which might be better for something like this? Thank you in advance!

Answers (3)

Sean de Wolski
Sean de Wolski on 30 Jul 2013
In order to get the axes sizes to be the same, use:
axis equal
As far as printing to specific dimensions, set the figure's 'PaperPosition' and 'PaperUnits' to inches and the location on the piece of paper you want to have printed. Then print it with print()

Azzi Abdelmalek
Azzi Abdelmalek on 29 Jul 2013
t=0:0.1:10
y=2*cos(t)+4
plot(t,y)
fig_width=5;
fig_length=10;
set(gcf,'Units','inches','position',[0 0 fig_width fig_length])
  1 Comment
Daniel Shub
Daniel Shub on 29 Jul 2013
You probably need to set the axis size to depend on XLIM and YLIM, otherwise things are going to be off. Unless your monitor is really well calibrated, the on screen size won't be perfect. Further, you will need to be careful when printing that the printer doesn't do scaling.

Sign in to comment.


Manbir
Manbir on 30 Jul 2013
The script did not work. I'm not exactly sure what it did if anything. I need the figure in polar a simple change from plot to polar but the figure didn't expand at all or maybe it did a very small bit but basically what it should be is the figure inside plot the actually drawing not including axes and all should be 8 inches around.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!