
How do I rotate a plot, but keep axes locations at the origin
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
I'm attempting to rotate the following plot:

using the code below. I'd like to rotate it 40 degrees counterclockwise. I can almost do this using the 'camroll' below, but when I do this, the X and Y axes are no longer pass through the origin, as they currently do. When I do it using camroll, I get the below figure:

which is almost perfect, except that I'd like the X and Y axis to still pass through the origin, such that they'd make an "X" in the middle of the figure, rather than a box around the figure's perimeter.
Thanks!
1 Commento
Ana Q
il 13 Mag 2016
Hi,
I am having the same difficulty, I want to rotate image a), 5 degrees clockwise, but when I do it (I already used view and camroll to rotate it) the y axis changes to the right side (see b). I tried to change it again to the left side or to origin with YAxisLocation but it didn't work

.
Does anyone know of a way to do it, keeping the axis in its original position? By the way i'm using Matlab 2015b.
Thank you!
Risposte (1)
Image Analyst
il 27 Mar 2016
Try some of the other functions like camdolly() or view(), etc. Lots of camera functions to try. See the help.
Otherwise you can manually draw lines on the axes
line([0, 0], ylim(), 'Color', 'k', 'lineWidth', 2);
line(xlim(), [0, 0], 'Color', 'k', 'lineWidth', 2);
Sorry, though, using line() won't give you tick marks. It simply draws lines, not axes. The tick marks will remain at the outer edges.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!