How can I plot text using normalized units?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
I have used the following commands:
subplot(2, 2, 1)
plot(y)
text('Units', 'Normalized', 'Position', [0.1, 0.1], 'text')
And get the following error message:
error using text
Too many non-property / value arguments.
채택된 답변
Walter Roberson
2022년 2월 24일
When you do not use the x, y, str triple, then you need to use the 'string' parameter name to designate the text to draw.
y = rand(1,20);
subplot(2, 2, 1)
plot(y)
text('Units', 'Normalized', 'Position', [0.1, 0.1], 'string', 'text to draw', )

댓글 수: 10
Sir,
Thank you for your input. I have tried your suggestion and it worked.
I looked carefully in the Matlab documentation :
and there did not seem to be a mention of this requirement. I have been programming since the 1980's and find Matlab to be the worst programming language I have ever dealt with.
https://www.mathworks.com/help/matlab/ref/text.html shows the valid syntaxes.
- axis positional property is optional first
- then you can optionally have x, y, string, or x, y, z, string
- name/value pairs go after that
None of the syntaxes permit name/value pairs before positional properties
I can't swear that there are absolutely no exceptions in any of the 10000+ functions supplied by Mathworks, but the standard for Mathworks is that name/value pairs always occur last in the calling sequence.
I have been programming since the mid 70s. COBOL was far far worse. Yacc+Lex are a struggle to learn how to use properly. teco was powerful but hard to learn. The vi editor was (is) useful but few people get as far as programming jumps in it. Perl has some interesting parts, but is "write only": if you take a break from any one program it is difficult pick up again later. SNOBOL is pretty useless. Some of the assembly languages I used were frustrating. A surprising number of the Unix utilities turn out to be programming languages. The programming languages of some of the network routers and switches are traps.
There is rather a lot of poor programming languages around.
I am just venting my frustration at how matlab doesn't really do a good job of explaining how to do anything outside of the vanilla norm. I grew to like IDL and now I mostly program in python and am starting to get into Julia. I am firmly entrenched in emacs and I detest the matlab editor. I realize that you can ask matlab to use emacs as the editor but then I have been unable to set up breakpoints which can be very handy, so I typically just use the horrible matlab editor. Perl was terrible in part because I never knew the state of the program and also the syntax is horrible. I still like C a lot but some of the newer languages are definitely easier to do some things in than C ever was. Once again thanks for your quick and helpful response.
I programmed in IDL for several years. It was ok. Got a bit clumsy for larger systems. We had to call out to C for the more intensive computations.
I liked IDL because it was able to make publication grade plots and was extremely flexible as to things like plotting greek symbols and color bars. None of my recently used languages (matlab, python, R) are as good and easy to use(in my opinion;-). I first used Matlab in 1991(Version 1 or 2) and as I recall it was unable to save plots in any format that I ever used.
I think you might have forgotten the mess that was font tables in IDL http://www.idlcoyote.com/ps_tips/greeksym.php
Hah, I still have an 8.5x11 sheet of paper with the translation between code and greek letter/symbol. At the time I pretty much had it memorized. It was not too bad, at least it was entirely consistent and predictable.(or that is how I am happily remembering it).
My peak IDL usage was while RSI (Research Systems Incorporated) still owned it. It was about the time of the Visible Human Project, and there was very nice volume viewing going on. MATLAB's volume viewing feels much weaker.
I remember RSI. I started to use IDL in the mid 90's and liked the company. I had friends from Boulder who knew all of the people on staff. What kind of work do you do now?
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Text Data Preparation에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
