MATLAB Answers

Why don't Axes camera properties seem to work?

2 views (last 30 days)
David Winthrop
David Winthrop on 18 Oct 2017
Edited: Stephen Cobeldick on 18 Oct 2017
I don't understand how the camera properties of the axes work. For example, say I draw a unit circle in the plane and put the camera directly above its center at a height of one unit. If I set the cameratarget to look quite far away from the circle and narrow the view angle, I should not be able to see the circle, but I can. An image of the final output is shown below. I am using r2012b.
Also, when adding an image to this question I noticed a significant difference between how the figure looks in the matlab window and how it is saved. It is saved more like I imagine it should look!! Why does it look so different in the figure window than when I save it as a png. I have attached both for comparison.
What is going on here?
Thanks.
Here is the code I am using.
t = linspace(0,pi,100);
x = cos(t);
y = sin(t);
plot3(x,y,zeros(size(x)))
hold on
plot3(-x,-y,zeros(size(x)))
set(gca,'cameraposition',[0,0,1])
set(gca,'cameratarget',[10,0,0])
set(gca,'cameraviewangle',25)
xlabel('x')
ylabel('y')

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.