필터 지우기
필터 지우기

How to do clock-wise increasing polar plot in matlab?

조회 수: 17 (최근 30일)
Sivakandan Mani
Sivakandan Mani 2015년 10월 8일
편집: Kelly Kearney 2015년 10월 8일
Dear all,
I want to draw polar plot with angle of increment is in clockwise direction. while doing polar plot in matlab the angle of increment will coming in anti-clockwise direction (by default). Now, I want to get it in opposite direction. So, anyone can help me? Note: I am using matlab 2012b. thank you, With best regards,
Sivakandan M
  댓글 수: 2
dpb
dpb 2015년 10월 8일
With great difficulty unless--*polar* is actually an ordinary cartesian axes with the transformation of coordinates from the input r,theta to x,y for plotting.
The radial spokes of the axes you see are thus just additional lines, not actually any real objects related to the polar coordinate axes they represent at all. And, the angle labels are text objects drawn at the [x*cos(t),y*sin(t)] coordinates in x,y space of the (invisible) axes on which it is all drawn as well.
Unfortunately, unless they've done it finally in the new HG2 release, TMW has never built any actual objects of any sort for handling polar, cylindrical or shperical coordinate systems. You've got to do it all from scratch if it isn't in the provided routines (which are pretty rudimentary, granted).
You might search File Exchange and see if anybody has provided enhanced versions.
Walter Roberson
Walter Roberson 2015년 10월 8일
In the earlier releases you can find the text objects and change them. Do you need the data tips switched over too?

댓글을 달려면 로그인하십시오.

채택된 답변

Kelly Kearney
Kelly Kearney 2015년 10월 8일
편집: Kelly Kearney 2015년 10월 8일
I recommend using mmpolar; it's far more flexible than polar in setting up your axes:
a = linspace(0, 2*pi);
r = exp(a)-1;
mmpolar(a, r, 'TDirection', 'cw')

추가 답변 (1개)

Star Strider
Star Strider 2015년 10월 8일
One possibility is to subtract the angle from the maximum value of the angle to ‘force’ a clockwise increase. (The polar function does not have many of the options other plots do, like reversing the axis direction.)
The example:
a = linspace(0, 2*pi);
r = exp(a)-1;
figure(1)
subplot(2,1,1)
polar(a, r)
title('Anti-Clockwise Increasing')
subplot(2,1,2)
polar((max(a)-a), r)
title('Clockwise Increasing')

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by