MATLAB Answers

My annotation of Greek letters fails with capital letters and without them. Any answer?

3 views (last 30 days)
>> Tbox=annotation('textbox',[.13,.39,.17,.085],'String','\alpha \beta \gamma \Gamma',...
' \delta \Delta \epsilon \zeta \eta \theta \Theta \iota \kappa \lambda \Lambda',...
' \mu \nu \xi \pi \Pi \rho \sigma \Sigma \tau \upsilon \Upsilon \phi \Phi \chi',...
' \psi \Psi \omega \Omega','BackgroundColor',[.5,.5,1])
Error using
Invalid parameter/value pair arguments.
Error in (line 6)
set(obj, pvpairs{:});
Error in
Error in annotation (line 140)
h ={:});

Accepted Answer

Image Analyst
Image Analyst on 3 Jul 2016
You can't split a string over multiple lines. A quoted string literal must be all on one line. Try this:
Tbox=annotation('textbox', 'Position', [.13,.39,.17,.085],'String','\alpha \beta \gamma \Gamma \delta \Delta \epsilon \zeta \eta \theta \Theta \iota \kappa \lambda \Lambda \mu \nu \xi \pi \Pi \rho \sigma \Sigma \tau \upsilon \Upsilon \phi \Phi \chi \psi \Psi \omega \Omega',...
  1 Comment
Kenneth Lamury
Kenneth Lamury on 3 Jul 2016
Using for example
Tbox=annotation('textbox', 'Position', [.13,.39,.17,.085],...
'$$\alpha \beta \gamma \Gamma $$',...
and doing this in several Tbox annotations gives desired results. Thanks!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!