The width of text is important, not the rectangle [Off Topic]
Hi Helmut,
thanks for your response. Perhaps my example was badly illustrated.
I am not trying to create a legend. I am trying to know how wide a text is, even if in the example I have illustrated the matter through something similar to the notion of a legend.
So, more generally:
I need to check if my text can fit within a span of dx units on a plot (dx in my example was the width of a rect, this rect was only for visualisation of the challenge).
If the text fits can then I am happy and if it can't then I need to change certain things, like creating two lines in stead of one (but changing cex is not the appropriate option). dx could also be the space between the two tall bars on the plot, or the entire plot area. And so forth.
Kindly allow me to rephrase:
I have a dynamic text s. I am going to put it on a plot. But I need to know if s at a given set of parameters and setting fits onto the plot within a width of dx units on the horizontal axis as one line. Nothing else.
thanks for your response. Perhaps my example was badly illustrated.
I am not trying to create a legend. I am trying to know how wide a text is, even if in the example I have illustrated the matter through something similar to the notion of a legend.
So, more generally:
I need to check if my text can fit within a span of dx units on a plot (dx in my example was the width of a rect, this rect was only for visualisation of the challenge).
If the text fits can then I am happy and if it can't then I need to change certain things, like creating two lines in stead of one (but changing cex is not the appropriate option). dx could also be the space between the two tall bars on the plot, or the entire plot area. And so forth.
Kindly allow me to rephrase:
I have a dynamic text s. I am going to put it on a plot. But I need to know if s at a given set of parameters and setting fits onto the plot within a width of dx units on the horizontal axis as one line. Nothing else.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- text function in R, how to get an idea of width? ElMaestro 2022-04-24 19:09 [Off Topic]
- Help is on the way Helmut 2022-04-24 22:24
- The width of text is important, not the rectangleElMaestro 2022-04-25 04:20
- I suggest strwidth() Helmut 2022-04-25 09:26
- The width of text is important, not the rectangleElMaestro 2022-04-25 04:20
- Help is on the way Helmut 2022-04-24 22:24