Entering edit mode
Hello,
I want to incorporate mathematical expressions in my legend for shapeCustom
but am not sure of how to do so. When setting up my keyvals.shape vector, I tried using names with R expression()
but this doesn't seem to work. Does anyone have any suggestions? In particular, suppose I have two shapes, one where I want the legend to be log_10(p)>50 and one with log_10(p)<=50 (expressed with subscripts and math symbols). How do I go about doing this?
Thank you!
Hi,
Yes, I've tried this, but I am not sure if it is possible to assign
bquote
values to the names of a vector. In particular, if I use anifelse
statement, I getOn the other hand, if I try to set
names
as a character before assigning the values, I get the following error:I am not too familiar with these functionalities in R, so I'd appreciate any suggestions. Thank you!
Ah, good point. You could instead try
Oh LOL. My markdown got edited by the markdown editor! What is between the p and 50 in the first case is the HTML for greater than or equal, which is
≥
, and in the next instance it's<
Oh snap. Foiled again. Here it is with spaces & ge ; and & lt ;
So basically you are using HTML markup to set your subscripts and whatnot, and then
element_markdown
does the rest.Thank you very much - that worked perfectly! Word of warning to those who try this: it screws up the other legends because of the markdown interpretation so I had to change those to the HTML notation as well.