Plotly_3D

Soumava Dey

10/19/2018

3D plot using Plotly package

p <- dataset%>%
  group_by(Segment)%>%
  plot_ly(x = ~ `Segment`, y = ~ Sales , z = ~ Profit, size = I(3), color = ~ `Segment`) %>%
  layout(title="Sales margin in different segments", xaxis=list(title="Segment"), yaxis=list(title="Sales range"), zaxis=list(title="Profit range"))
p
## No trace type specified:
##   Based on info supplied, a 'scatter3d' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter3d
## No scatter3d mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
## Warning: 'layout' objects don't have these attributes: 'zaxis'
## Valid attributes include:
## 'font', 'title', 'titlefont', 'autosize', 'width', 'height', 'margin', 'paper_bgcolor', 'plot_bgcolor', 'separators', 'hidesources', 'smith', 'showlegend', 'xaxis', 'yaxis', 'ternary', 'scene', 'geo', 'mapbox', 'radialaxis', 'angularaxis', 'direction', 'orientation', 'dragmode', 'hovermode', 'hoverlabel', 'legend', 'annotations', 'shapes', 'images', 'updatemenus', 'sliders', 'calendar', 'barmode', 'bargap', 'mapType'