How can I xticks at equal distance

4 views (last 30 days)
SOHAIB AHMAD
SOHAIB AHMAD on 21 Feb 2020
Commented: Sindar on 21 Feb 2020
I am trying to plot the graph betweek gain K and frequency F_x, I want the graph to be plotted for only these three [0.1 1 10] values. When i plot the graph, the distance between these values are not equal as shown in the picture. The commadns that I am using at below.
plot(F_x,K)
hold on
axis([0.1 10 0 3])
xticks([0.1 1 10])
Any help is much appreciated,

Answers (1)

Sindar
Sindar on 21 Feb 2020
Assuming you want them equally spaced because they are equally spaced on a log scale:
semilogx(F_x,K)
xticks([0.1 1 10])
  1 Comment
Sindar
Sindar on 21 Feb 2020
If you want the plot to look exactly the same (linear scale), but be labeled uniformly (i.e. incorrectly):
plot(F_x,K)
xticks([0.1 5.05 10])
xticklabels([0.1 1 10])

Sign in to comment.

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!