3

I used the semiologx command to generate these two plots, but I need the plot to show more reference values on the X axis. enter image description here

How can this be accomplished in MATLAB?

1 Answer 1

2

It seems your plot was generated by semilogx, not semilogy. Anyway you can set the values on the x axis (called "ticks") using (for example):

set(gca, 'xtick', [1 10 100 1000])

The 1st argument is the axis handle you wish to change, in this example I just use gca which stands for "get current axes", and returns the currently active axes.

Sign up to request clarification or add additional context in comments.

2 Comments

OP said semilogx, but Horchler edited it to semilogy. Funny that googling "MATLAB xtick" does not get you this syntax as a first documentation result; I knew it was xtick, just not the exact syntax...
@Adriaan It does for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.