How to include word-strings into a matlab picture as part of the image?

1 回表示 (過去 30 日間)
Soabon
Soabon 2015 年 2 月 12 日
コメント済み: Soabon 2015 年 2 月 12 日
Hi there,
with the following script a grey figure with a dark grey cross is created. I want to replace the cross (symbol) with a letter string, to be varied regarding color and size. How can this be done with MATLAB?
Kind regards! Laura
clear all
rand = rand(300,400); % create random pic size "600,800"
pic = ones(size(rand)); % create white pic size as random
background = pic*0.5; % make it gray 0.5
T = figure(1); % Plot figure
imshow(background);
hold on
plot((size(pic,2))/2, (size(pic,1))/2, '+', 'MarkerEdgeColor',[0.4 0.4 0.4],... 'MarkerFaceColor',[.4 .4 .4],'MarkerSize',20 , 'LineWidth',5)
hold off

採用された回答

Stephen23
Stephen23 2015 年 2 月 12 日
編集済み: Stephen23 2015 年 2 月 12 日
Have a look at text . it places text on a figure, and has various properties that you can specify.
  2 件のコメント
Soabon
Soabon 2015 年 2 月 12 日
Hey, thanks - it's easy like this. And how do you change color/style/size?
text((size(pic,2))/2, (size(pic,1))/2, 'tryin')
Soabon
Soabon 2015 年 2 月 12 日
Oh, I got it.. perfect

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScripts についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by