How do I create non uniform spacing between axis ticks like in figure ?

33 ビュー (過去 30 日間)
Francesco Gigante
Francesco Gigante 2017 年 12 月 15 日
コメント済み: Amy 2020 年 5 月 14 日
I'm trying to create a ticks distribution like the one in figure
...I really can't figure how to do it. Do I have to define the x-variable in a particular way or is it just an axis and ticks thing ?
  2 件のコメント
Stephen23
Stephen23 2017 年 12 月 18 日
Have you tried semilogx? Is this close enough?
Francesco Gigante
Francesco Gigante 2018 年 2 月 5 日
I did use the semilogx and specified certain ticks values. Thanks for helping !

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

採用された回答

Amy
Amy 2017 年 12 月 18 日
編集済み: Amy 2020 年 5 月 14 日
Hi Francesco, take a look at this documentation page if you haven't already: Specify Axis Tick Values and Labels
There is also an example of setting nonuniform x-axis tick locations on the documentation page for 'xticks'.
adding to this (5/14/20): It looks like you also wanted to use a logarthmic scale for the x-axis and semilogx was already suggested.
You can also use xlim to specify limits for the x-axis.
  2 件のコメント
LR
LR 2019 年 1 月 22 日
編集済み: LR 2019 年 1 月 22 日
I'm not sure why this answer was accepted... the question as I understand it is about stretching and compressing the x axis, not just speciftying xticks or xticklabels. The documentation pointed out does not contain information on stretching/compressing axes.
Amy
Amy 2020 年 5 月 14 日
Thanks LR, I edited my answer to include the links to documentation for setting a log scale and limits on the x-axis, which had already been suggested in the comments.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by