Axes Limits
MATLAB provides us with options to change the limits of r and theta axis by using the rlim() and thetalim() functions.
Syntax:
rlim(<limits of r-axis>)
thetalim(<limits of theta-axis>)
We can pass a certain range for the limits of r-axis and theta-axis and the above functions will change the visible range of the polar axes. We will plot a sin curve in polar axes with theta ranging from 0 to 270 degrees and r ranging from 0 to 1.5.
Example 1:
Matlab
% MATLAB code for % Defining polar axes ax=polaraxes; % Defining x data r=linspace(-pi,pi); % Plotting sin(r) in axes ax plot(ax,r,sin(r)) % Setting r-limits to 0->1.5 rlim([0 1.5]) %Setting theta-limits to 0->270 degrees thetalim([0 270]) |
Output:
Polar Axes Appearance and Behavior in MATLAB
Polar axes are coordinate axes where the two coordinate axes are r-axis for magnitude and theta-axis for angles. MATLAB has many functions to change the properties of these polar axes which we shall see throughout this article. In this article we shall see how to modify following properties of polar axes in MATLAB:
- Axes limits
- Axes ticks
- Axes tick labels
- R-axis tick angle
Let us see each of these with an example each.