plot CCDF with absolute value, not percent: now max CCDF (Y-scale) is 100% but I;d like to have 1.0

4 次查看(过去 30 天)
Noe PlotCCDF provides Y-scale in percents. The max is 100 (10^2)
I am interesting in the absolut values at Y axis i.e. 100% -> 1.0.
Is there a way hot to do it?

采纳的回答

R
R 2024-6-19
Yes, there is a way to plot the CCDF with absolute values on the Y-axis. You can use the set function in MATLAB to modify the Y-axis tick labels. Here's an example:
% Generate some data
x = complex(rand(10000,1)-0.5,rand(10000,1)-0.5);
pm = powermeter(ComputeCCDF=true);
averagePower = pm(x); % power in dB
% Plot the CCDF
plotCCDF(pm,GaussianReference=true);
% Modify the Y-axis tick labels
yticks = get(gca, 'YTick');
yticklabels = arrayfun(@(x) sprintf('%.4f', x/100), yticks, 'UniformOutput', false);
set(gca, 'YTickLabel', yticklabels);
In this example, the yticks variable stores the current Y-axis tick values, and the yticklabels variable generates new tick labels by dividing each tick value by 100 and formatting it as a string with one decimal place. Finally, the set function is used to update the Y-axis tick labels.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by