I’m plotting a factor on the x-axis, so each point is labeled with the name of the factor. Since the text would overlap if plotted horizontally, I’m plotting it all vertically. However, I then will occasionally run into issues with the x-axis margin not being large enough. So, my question: Is there a way to determine how long a text string will be when plotted (in, say, inches)?
Share
I believe you are looking for
strwidthin thegraphicspackage.To use it, first plot your graph. Then simply call
strwidth("your string")eg:
If you are plotting rotated text, It’s possible you may want to use
strheight(analogous functionality)