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

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

 Risposta accettata

Stephen23
Stephen23 il 12 Feb 2015
Modificato: Stephen23 il 12 Feb 2015
Have a look at text . it places text on a figure, and has various properties that you can specify.

2 Commenti

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Images in Centro assistenza e File Exchange

Richiesto:

il 12 Feb 2015

Commentato:

il 12 Feb 2015

Community Treasure Hunt

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

Start Hunting!

Translated by