bining x in plots

3 ビュー (過去 30 日間)
Susan Ghaderi
Susan Ghaderi 2019 年 10 月 28 日
回答済み: Siriniharika Katukam 2019 年 10 月 31 日
Hi,
I have a problem regarding bining x axis in a plot.
I have an array that I want to plot it. In biochemistry is cardinality of reactions.
Then my boss asked me:
"x axis should be binned and put into log10 scale to show linear relationship. I think you need to create bins on the x scale, equally spaced in log scale, then the value of each bin is the number of reactions with cardinality between an interval on log scale. This code may help...
But I do not know how to plot is in the way that we see linearity with bining x logarithmly?
I would be appricaite if someone could guide me?
Best regards,
Susan
  4 件のコメント
darova
darova 2019 年 10 月 28 日
You mean this?
x = log10(1:n);
plot(x,s)
Susan Ghaderi
Susan Ghaderi 2019 年 10 月 28 日
No, I do not think so. Becasue it does not show something linear.I guess he means something like figure 5 in this link https://arxiv.org/pdf/1011.1533.pdf
But I do not know how to get that.

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

回答 (1 件)

Siriniharika Katukam
Siriniharika Katukam 2019 年 10 月 31 日
Hi
Try replacing
plot(x,y)
to
semilogx(x,y)
‘semilogx’ turns the x-axis to a Logarithmic scale as in the figure that you provided in the above commented link. Further details can be got from this link:
and for logarithmic scale on y-axis, use ‘semilogy’.

カテゴリ

Help Center および File ExchangeFormatting and Annotation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by