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 件のコメント
John Williams
2022 年 2 月 24 日
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.
Walter Roberson
2022 年 2 月 24 日
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.
Walter Roberson
2022 年 2 月 25 日
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.
John Williams
2022 年 2 月 25 日
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.
Walter Roberson
2022 年 2 月 25 日
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.
John Williams
2022 年 2 月 25 日
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.
Walter Roberson
2022 年 2 月 25 日
I think you might have forgotten the mess that was font tables in IDL http://www.idlcoyote.com/ps_tips/greeksym.php
John Williams
2022 年 2 月 25 日
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).
Walter Roberson
2022 年 2 月 27 日
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.
John Williams
2022 年 2 月 28 日
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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
