1

Why do we need to use AsIs operator (i.e. I(x)) while defining symbols, colors and sizes in plotly graphs? The explanation in the official documentation is rather sketchy and obscure.

Let's say, I want to get standard point characters. In the Base plotting system I would type something like this:

plot(x = 1:25, y = 1:25, pch = 1:25)

A similar command in plotly gives only 6 characters instead of 25:

plot_ly(x = 1:25, y = 1:25, symbol = 1:25)

To reproduce Base plotting system, one needs to pass the vector 1:25 to AsIs operator:

plot_ly(x = 1:25, y = 1:25, symbol = I(1:25))

So, why couldn't we simply pass 1:25 to plot_ly, like we did that in plot?

Simeon Y.
  • 155
  • 9
  • It gives you warnings.:`The shape palette can deal with a maximum of 6 discrete values because more than 6 becomes difficult to discriminate; you have 25. Consider specifying shapes manually if you must have them. ` `I()` just enforces using 25 shapes. – M-- Aug 31 '17 at 21:19
  • Thank you. I know that, but I have no clue what is the "shape palette" and why it can't deal with more than 6 values. Perhaps, I simply don't understand the way, this palette works. – Simeon Y. Aug 31 '17 at 21:25

0 Answers0