Rotating a plot?

前端 未结 3 2148
孤城傲影
孤城傲影 2021-02-19 21:40

I have obtained an x-y plot in Matlab of the sine curve and I wish to rotate this plot by 90 degrees counter clockwise. How do I do this?

3条回答
  •  无人共我
    2021-02-19 22:15

    Another solution is function view:

    view([90 90])
    

    In my opinion this is better solution because there is a problem with labels when one uses camroll function. See code below:

    y = rand(1,10);
    subplot(211)
    plot(1:10,y)
    xlabel('x')
    ylabel('y')
    view([-90 90])
    subplot(212)
    plot(1:10,y)
    xlabel('x')
    ylabel('y')
    camroll(90)
    

提交回复
热议问题