Semilog x axis for Scatter Plot

77 ビュー (過去 30 日間)
CMatlabWold
CMatlabWold 2020 年 6 月 23 日
コメント済み: Star Strider 2020 年 6 月 25 日
Hi, I am trying to plot points, with the x-axis in log scale.
This is my code
ss0 = readtable('MedianBeta.xlsx')
x = ss0{:,2}
y1= ss0{:,3}
y2= ss0{:,4}
y3= ss0{:,5}
y4= ss0{:,6}
scatter(x,y1,'r')
hold on
%scatter(x,y2,'k')
%hold on
%scatter(x,y3,'m')
%hold on
%scatter(x,y4,'g')
%hold on
set(gca,'xscale','log')
title('Median and Catch')
xlabel('Median')
ylabel('Beta')
It seems simple enough. However, the plot I get is not the logarithmic, with 10^0, 10^1, etc..., that I was looking for (Yet, when I reverse it and set y-axis as log, it does go with the traditional scale of 10^0, 10^1, 10^2, etc. It is just not doing it with the x-axis)
Also, there becomes a point at 0 on the x axis, which is inaccurate. There are no zero values for Median.
Something is off. I'd appreciate any help.
Thank you

採用された回答

Star Strider
Star Strider 2020 年 6 月 23 日
The plot is working correctly. To more easily see that it is, add this xlim call (temporarily):
xlim([0.01 10]*1E+5)
.
  6 件のコメント
CMatlabWold
CMatlabWold 2020 年 6 月 25 日
Thank you!
Star Strider
Star Strider 2020 年 6 月 25 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by