can i make text extents smaller? or more uniform?

most of the extents of text objects on my system do not have uniform margins surrounding the text glyph. why is the extents/background so big? is there a way to make it smaller?
the margin property does not take negative values.
mostly, i want to have the extent be as close to the text as possible so i can use backgroundcolor=white to make the text annotation "pop" off the axes minor grid lines, but without interfering with other things nearby.
i suppose i could create an independent rectangle and place that. is there another way? note how the red background color is much taller than the glyph and that the left hand margin is much smaller than the right hand one

4 comentarios

Jan
Jan el 13 de Dic. de 2011
Could you post a more readable image? Red font on red background is funny, but not useful.
How do you create the text object? Could you post an example to demonstrate the problem? "Make the text annotation "pop" off the axes minor grid lines while ensuring it's behind any of the plotted data" is not enough to let me imagine, what you are trying to achieve.
Eric
Eric el 13 de Dic. de 2011
thanks jan. posted a less pixelized image and clarified question a bit.
Jan
Jan el 13 de Dic. de 2011
And now you want the read area to be tight around the text? How tight?
Eric
Eric el 14 de Dic. de 2011
as tight as possible. but frankly any ability to make the margin smaller would be useful. right now i'm placing smaller rectangles before i place the text and aligning the rectangle and text can be difficult when horizontal alignment changes, text reports inaccurate extents, etc

Iniciar sesión para comentar.

Respuestas (3)

Daniel Shub
Daniel Shub el 13 de Dic. de 2011

0 votos

Based on your language I am going to go with NO. You can hammer on MATLAB and get reasonable looking figures and interfaces, but it lacks the fine level of control required to produce really polished things. Unless you have tight control over the hardware or printing, hand fiddling things is a waste of time because MATLAB often changes things across machines, OSs, and versions.
Daniel Shub
Daniel Shub el 14 de Dic. de 2011

0 votos

What about building the text and background in another program and then importing it into the figure as a image? If you need dynamic labels you could write a function that takes the desired texts and creates a postscript file with the desired text and bounding box.

1 comentario

Eric
Eric el 14 de Dic. de 2011
interesting suggestion. it'll be way too slow if i have 0..5 text labels in a single plot, 4..12 in a figure page and possibly 10..100 pages. particularly because the users are usually in AFS space, possibly over a vpn. the white background rectangle with over-layed separate text is working fine for now. i'm just fiddling with details. i'm surprised if no one else wants tighter control on the text object margin. thanks again for an interesting option that might help others.

Iniciar sesión para comentar.

Jan
Jan el 14 de Dic. de 2011

0 votos

So you do not need another program, but you can create the text in Matlab and crop the border directly. An equivalent procedure is done in FEX: uibutton.
Does your example picture use a small 'Margin' property already? It must be greater than 0, e.g. 0.0001.
[Edited]: If you do not define the Margin property explicitely, it is set to the default 2! 0.01 is tighter.

2 comentarios

Eric
Eric el 19 de Dic. de 2011
no margin property setting in above image. thanks Jan, i'll look into uibutton and the other question/answer
Jan
Jan el 19 de Dic. de 2011
Edited.

Iniciar sesión para comentar.

Categorías

Más información sobre Text Analytics Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 13 de Dic. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by