How would I add a log scale (i.e 10^-1) as an x axis label to this polar plot?
5 views (last 30 days)
Show older comments
Hi there!
I was wondering if it was at all possible to include a log scale on the x-axis of the graph created by my attached code!
I tried the semilogx function but an error message is returned.
Any help would be greatly appreciated!
My code is as follows and the Mat-file with the relevant data is attached.
clear all; % clear all data to avoid confusion
close all; % Close all previous graphs to avoid confusion
%%
load('matlab both gamma - Copy'); % Load data file.
figure (); % Open a new graph
leg={}; % Declare legend as leg
for i=1:length(data) % Loop over all data
polarplot(data(i).beta*pi/180,log(data(i).Ns)); % Polar plot data with angle =beta (in radian), and radius =Ns.
hold on; % Keep the data. Next plot will plot on the same graph
leg = [leg, data(i).name]; % Add the name of data to leg
end
thetalim([0 90]); % Set theta limit to 90 degrees
thetaticks(0:5:90); % Set theta ticks to 10 degrees
rticks(0:0.2:90); % Set Ns ticks to 2 (max 24 for this data)
legend(leg); % Set legend as leg
rticklabels({'','','','','','Ns','','','','','',''}); % Set label for radius
0 Comments
Answers (1)
Kevin Holly
on 29 Sep 2021
h = gca;
h.RAxis.Scale = 'log'
"The coordinate system or ruler class does not support log axis scale."
I found a workaround here:
0 Comments
See Also
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!