Can you change line spacing in a textbox created with annotation?

13 views (last 30 days)
I am trying to display a line of text in a custom font in a figure and I need a very specific space between lines. Can the spacing between lines of text created in a texbox using annotation be set and if so how?
  7 Comments
Thierry Guillaume
Thierry Guillaume on 16 May 2021
I have been able to implement your function in my code, but have encountered a new problem: My goal is to display a block of text in a figure in a particular font, particular size, particular colour. The text is contained in a 6 x 6 char array. I can display the character array using annotation, in the desired colour, fonttype, etc. but when i call your function asking it to modify the line spacing, it displays the char array again at the coordinate specified and with the line spacing required but the font style and colour have been rest and I cannot change them. Do I need to add the fontsize , colour, etc to the function code?
Thierry Guillaume
Thierry Guillaume on 16 May 2021
I resolved this by changing the parameters of the last line of the function code: I just changed the properties of hf=text(x,y,flip(sf))... It worked! Thank you ever so much Scott.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!