Need Help getting a 1:1 scale on a plot

111 次查看(过去 30 天)
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!

回答(3 个)

Sean de Wolski
Sean de Wolski 2013-7-30
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 2013-7-29
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 个评论
Daniel Shub
Daniel Shub 2013-7-29
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.

请先登录,再进行评论。


Manbir
Manbir 2013-7-30
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.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by