2 years ago

#50315

test-img

ahmad

Add axis to plotly in R

library(maps)
library(plotly)
Mix.percent=outliers_df.rn$Mix.Percentage*100
Diff.percent=outliers_df.rn$Diff.Percentage*100

Mid.Mix=max((Mix.percent)+min(Mix.percent))/2
Mid.Diff=max((Diff.percent)+min(Diff.percent))/2

fig <- plot_ly(data = outliers_df.rn,  x = ~(Mix.Percentage*100), y = ~(Diff.Percentage*100), 
              type = 'scatter', mode = 'markers',
              text = ~paste('Quotedate :', quotedate,
                            '¦ Factor: ', factor,
                            '¦ Segment: ', segment,
                            '¦ KPI: ', KPI))
#lines(x = Mid.Mix, y = outliers_df.rn$(Diff.Percentage*100), col = "blue")

#lines( x = lowess( x = x, y = y ), col = "darkgoldenrod2", lwd = 4 )
fig <- layout(fig, xaxis = list(type = "log"),
             yaxis = list(type = "log"))

fig

Please, find my plot just below:

enter image description here

However, I would like to add x-axis and y-axis to this plot as follows:

  • x-axis at y = 1000
  • y-axis at x = 500

r

r-plotly

0 Answers

Your Answer

Accepted video resources