필터 지우기
필터 지우기

How can I change the scaling of the y-axis on a semilogy plot?

조회 수: 12 (최근 30일)
Hello, I am having a problem with log plots and could use some kind assistance. Basically, I am plotting bit error rate (BER) curves for a telecommunications system. I have a vector for my y-axis (BER) values and a vector for the corresponding x-axis values. Using the semilogy command, I get my plot and it is fine. However, the y-axis tick marks (i.e. 10^-2, 10^-4, 10^-6, etc.) all have equal spacings between them. I am trying to find a way to scale the y-axis such that it is somewhat "to scale", that is, the spacing between 10^-6 and 10^-4 should be proportionately smaller than that between 10^-4 and 10^-2, and so on. I understand it is pointless for the spacings to be exactly proportional (lest the spacing between 10^-6 and 10^-4 would be 100 times smaller than that between 10^-4 and 10^-2!) but as long as it can be shown graphically that the spacings have been scaled, that will be good.
I would have like to attach some graphs as examples, but am unsure if Mathworks has this feature. Any help will be appreciated.
Kind regards,
Nicholas

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 30일
set(gca,'yscale','log')
  댓글 수: 1
Nicholas Wong
Nicholas Wong 2013년 5월 30일
Thank you very much for the answer. It worked, though I had to manually convert my values into log scale and then use the plot command instead of semilogy. I did try it with a semilogy plot but there was no effect, probably because that is already in log-scale. Nevertheless, I got what I was after.

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

추가 답변 (1개)

Hadi Hajieghrary
Hadi Hajieghrary 2013년 5월 30일
Semilogx make the spacing between the ticks If you want the spacing be proportional you shouldn't then use the "semilog". As I understood you just want the ticks are placed on their real places, and just in logaritmic steps. Then do it in a simple plot command, and then go to the plot tool and place ticks wherever you want for the y-axis.
  댓글 수: 1
Nicholas Wong
Nicholas Wong 2013년 5월 30일
Yes, you understood my question correctly. I should have realised that property of semilogy. Thanks.

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

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by