Product: TIBCO Spotfire®
How to create Bold and Italic text in command-line graphs
The customer wants to add text to a command-line graph that is either bold or italicized.
Unfortunately, there is not an option for bold text in command line plots (including using the text() function).
There is an enhancement request already filed to have this feature added to future releases of S-PLUS.
In the meantime, you can work around the problem by plotting the text twice, offsetting it slightly the
second time to make it appear bold. Here is an example using mtext():
plot(1:10, xlab = "", ylab = "")
mtext("Make Bold", side = 1, line = 3, at = 5.5)
mtext("Make Bold", side = 1, line = 3, at = 5.5 + 0.01)
# Press F2 to view graph
Another alternative is to insert text through the GUI or create a GUI plot. To insert text, select
'Insert | Text' from the main menu. In the text box that appears, right-click and select Font.
Choose 'Bold' for the Font Style and click OK. Then type your text and click outside the box.
Again, press F2 to view the graph. The gui function that creates this text is guiCreate( "CommentDate",...).
Here is an example of how to use this at the S-PLUS command prompt:
> plot(1:10)
> guiCreate( "CommentDate", Name = guiGetGSName(), Title = "Test BOLD Italic", FillColor = "Transparent",
Bold = T, Italics = T, xPosition = "2", yPosition="8")
You can read about the guiCreate(CommentDate) and the guiGetGSName functions by typing the following at
your S-PLUS command prompt:
> ?GCCommentDate
> ?guiGetGSName
A third option to italicize and bold font from the command line is to right click on the command line graph and
select "Convert to Objects". You can now select the text and right click to select Font. Then you can choose
to italicize or bold the font.
Comments
0 comments
Article is closed for comments.