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

1 view (last 30 days)
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

Accepted Answer

Stephen23
Stephen23 on 12 Feb 2015
Edited: Stephen23 on 12 Feb 2015
Have a look at text . it places text on a figure, and has various properties that you can specify.
  2 Comments
Soabon
Soabon on 12 Feb 2015
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')

Sign in to comment.

More Answers (0)

Categories

Find more on Scripts in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!