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

1 visualizzazione (ultimi 30 giorni)
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
Soabon
Soabon il 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')

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Scripts in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by