-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from lorenzo2897/interactives
Plotly standard now fully supported
- Loading branch information
Showing
3 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot | ||
|
||
from plotly.graph_objs import Scatter, Figure, Layout | ||
|
||
init_notebook_mode(connected=True) | ||
|
||
iplot([{"x": [1, 2, 3], "y": [3, 1, 6]}]) | ||
|
||
|
||
|
||
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot | ||
|
||
import plotly.graph_objs as go | ||
|
||
import pandas as pd | ||
|
||
# Read data from a csv | ||
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv') | ||
|
||
data = [ | ||
go.Surface( | ||
z=z_data.as_matrix() | ||
) | ||
] | ||
layout = go.Layout( | ||
title='Mt Bruno Elevation', | ||
autosize=False, | ||
width=500, | ||
height=500, | ||
margin=dict( | ||
l=65, | ||
r=50, | ||
b=65, | ||
t=90 | ||
) | ||
) | ||
fig = go.Figure(data=data, layout=layout) | ||
iplot(fig) | ||
|
||
|
||
|
||
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot | ||
|
||
import plotly.graph_objs as go | ||
|
||
|
||
z1 = [ | ||
[8.83,8.89,8.81,8.87,8.9,8.87], | ||
[8.89,8.94,8.85,8.94,8.96,8.92], | ||
[8.84,8.9,8.82,8.92,8.93,8.91], | ||
[8.79,8.85,8.79,8.9,8.94,8.92], | ||
[8.79,8.88,8.81,8.9,8.95,8.92], | ||
[8.8,8.82,8.78,8.91,8.94,8.92], | ||
[8.75,8.78,8.77,8.91,8.95,8.92], | ||
[8.8,8.8,8.77,8.91,8.95,8.94], | ||
[8.74,8.81,8.76,8.93,8.98,8.99], | ||
[8.89,8.99,8.92,9.1,9.13,9.11], | ||
[8.97,8.97,8.91,9.09,9.11,9.11], | ||
[9.04,9.08,9.05,9.25,9.28,9.27], | ||
[9,9.01,9,9.2,9.23,9.2], | ||
[8.99,8.99,8.98,9.18,9.2,9.19], | ||
[8.93,8.97,8.97,9.18,9.2,9.18] | ||
] | ||
|
||
z2 = [[zij+1 for zij in zi] for zi in z1] | ||
z3 = [[zij-1 for zij in zi] for zi in z1] | ||
|
||
data = [ | ||
go.Surface(z=z1), | ||
go.Surface(z=z2, showscale=False, opacity=0.9), | ||
go.Surface(z=z3, showscale=False, opacity=0.9) | ||
|
||
] | ||
|
||
iplot(data,filename='python-docs/multiple-surfaces') |