to change the scale of a plotted graph

Hi fellow friends,
I want to change the scale of a graph to a new scale. previous scale is start from 0 with the increment of 0.5. this graph and scale is auto generated from the data. my coding for plotting as below.
bit_error(1,oye) = sum(m5~=data_topi); % BER
Eb_No=snr(oye)-3; EbNo=10^(Eb_No/10);
% fprintf('Looping = %1d, SNR = %1d, BitError = %1d,...
% jum,snr(oye),bit_error(oye));
% if snr(oye) == max(snr)
% display('*****************************');
% end
end
total_bit_error(jum,:) = bit_error;
end
BER = sum(total_bit_error)/(length(m5)*iteration);
figure; % BER vs SNR in linear value
plot(snr,BER,'ro-'); hold on
grid on
xlabel('\fontname{calibri}{SNR}')
ylabel('\fontname{calibri}{BER}')
title('\fontsize{10}{BER vs SNR in Linear Value}')

3 Comments

Are you referring to the tick marks and tick labels?
What would you like to have show up?
the existing y axis start from 0 scale with the increment of 0.5. i want make it start with 0,0.01,0.02,0.03,0.04,0.05 and so on up to 0.25
yes the tick marked and tick labels..i want it become 0 0.01,0.02 an d so on

Sign in to comment.

 Accepted Answer

yticks = [0 : 0.01 : 0.25];
set(gca,'YTick', yticks, 'YTickLabel', cellstr(num2str(yticks(:))) );
However, if the current automatic scaling has its first tick at 0.5 then I predict that the result of the above would be to crowd a lot of ticks in to a small portion of the graph.
If the first tick is at 0.5 then your BER must have values that are at least 0.8 (and probably higher.) Do you want the ticks to just stop at 0.25 leaving the rest unlabelled but visible? Do you want the part of the graph above 0.25 to be cut off and only up to 0.25 shown? Do you want the full range of BER values to be plotted, but for the tick labels to "lie" above the values by labeling (e.g.) 1.72 as if it were 0.21 ?

1 Comment

Thanks Walter,
U r rite, the result too crown with a lot of ticks. huhu... Actually I want the tick for Y axis every 0.01 up to the max and not up to 0.25 only(full range of BER value).so that it is easier for me to analyse the data more accurately.help please.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!