Skip to content

Instantly share code, notes, and snippets.

@rgbkrk
Created September 16, 2016 18:51
Show Gist options
  • Save rgbkrk/58385d5436be245950d793c3e875bbf8 to your computer and use it in GitHub Desktop.
Save rgbkrk/58385d5436be245950d793c3e875bbf8 to your computer and use it in GitHub Desktop.
iris plotting with custom plotly mimetype
layout = list(
scene=list(
xaxis=list(title="sepal length [cm]"),
yaxis=list(title="sepal width [cm]"),
zaxis=list(title="petal length [cm]")
),
title="Iris dataset"
)
data = list(
x=iris$Sepal.Length,
y=iris$Sepal.Width,
z=iris$Petal.Length,
marker=list(
line=list(color="black", width=1),
opacity=0.7,
size=12
),
mode="markers",
name="Iris-setosa",
type="scatter3d"
)
figure = list(data=data, layout=layout)
IRdisplay::publish_mimebundle(list('application/vnd.plotly.v1+json'=figure))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment