How do I change axes limits for a semilogx plot

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

 채택된 답변

dpb
dpb 2014년 3월 2일

0 개 추천

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).

댓글 수: 4

Nothing to do but hit myself on the forehead...
I did look at the documentation, but when you google matlab axes the first thing that comes up is the axis page, and I missed the difference...
Thanks
dpb
dpb 2014년 3월 2일
Why on earth would one DAGS for "axes" instead of
help axes % or doc axes
??? where one finds that the syntax used isn't correct for axes and "See Also" lists *axis"?
@dbp : In my experience Google search gets relevant answers faster on most questions. The "See also" references are often nearly useless. I've been led on many a wild goose chase using only Mathworks built in help tools.
I'd disagree with basic syntax and probably most others as other sources being quicker than the help files...other than perhaps looking for new functionality that aren't sure of which is the proper function the more general search pattern might uncover a reference to the function by a different phrase than what is in the online references.
I'd be interested in a specific example...surely the answer to OPs question here is simply reading the syntax for the function directly from the help line...which leads to a very useful technique to find new functionality or to learn name for one that aren't familiar with is to start with just
help
and then delve into the appropriate subsections. 'lookfor' is also helpful for such. It also may be an age thing; users from the age of 3-ring binders printed 8.5x11 pages from IMSL being the cat's meow in doc probably are much more comfortable with text-based tools...not that I'm old or anything at all like that... :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

질문:

2014년 3월 2일

댓글:

dpb
2017년 8월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by