سؤال

Is there a way to insert symbol of arrow (other than simple " -> ") into a legend in R?

legend(locator(1), c("1 -> 2", ...))

Thank you.

هل كانت مفيدة؟

المحلول 2

Thank you for suggestions. So, one of the possible answers how to insert arrow (i.e. to show transitions from x to y) into the legend may look like this:

plot.new() # empty plot
legend("topright", c(expression(x[1] %->% y[1]), expression(x[2]%->%y[2])),  col=4, bty="n")

نصائح أخرى

If you put this in without modification you will get an error, so why not post a complete example?

  legend(locator(1), c( expression(1 %->% 2), ...))

The appropriate place to look further is ?plotmath.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top