MATLAB: How to change axes limits for a semilogx plot

axeslogsemisemilogx

Hey,
I'm trying to change the axes limit on a semi log plot, but it's failing, and googling didn't bring up anything 🙁
Basically, how do i make this works and not return an error:
>> x= [1 10 100];
>> y = [0 1 2];
>> semilogx(x,y);
>> axes([0.1 1000 -1 3])
Error using axes
Invalid object handle
Thanks

Best Answer

You mean
axis([0.1 1000 -1 3])
instead...always see doc's for details to ensure you've got syntax correct first (of course, it's possible you thought you typed axis instead of axes and got "editor's block" of seeing what you think you should see instead of what's there).