MATLAB Answers

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

조회 수: 167(최근 30일)
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

Francesco Gigante
Francesco Gigante 5 Feb 2018
I did use the semilogx and specified certain ticks values. Thanks for helping !

로그인 to comment.

채택된 답변

Amy MacDonough
Amy MacDonough 18 Dec 2017
편집: Amy MacDonough 14 May 2020 17:31
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 22 Jan 2019
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 MacDonough
Amy MacDonough 14 May 2020 17:36
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.

로그인 to comment.

추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by