Skip to content

Latest commit

 

History

History
113 lines (98 loc) · 3.71 KB

3d-wireframe-plots.md

File metadata and controls

113 lines (98 loc) · 3.71 KB
jupyter
jupytextkernelspecplotly
notebook_metadata_filtertext_representation
all
extensionformat_nameformat_versionjupytext_version
.md
markdown
1.1
1.1.1
display_namelanguagename
Python 2
python
python2
descriptiondisplay_aslanguagelayoutnameorderpermalinkthumbnail
How to make wireframe plots in Python
3d_charts
python
base
3D Wireframe Plots
8
python/3d-wireframe-plots/
thumbnail/wireframe.jpg

New to Plotly?

Plotly's Python library is free and open source! Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode, or in jupyter notebooks.
We also have a quick-reference cheatsheet (new!) to help you get started!

Basic Wireframe Plot

importplotly.plotlyaspyimportplotly.graph_objsasgoimportnumpyasnp# Creating the datax=np.linspace(-5, 5, 50) y=np.linspace(-5, 5, 50) xGrid, yGrid=np.meshgrid(y, x) R=np.sqrt(xGrid**2+yGrid**2) z=np.sin(R) # Creating the plotlines= [] line_marker=dict(color='#0066FF', width=2) fori, j, kinzip(xGrid, yGrid, z): lines.append(go.Scatter3d(x=i, y=j, z=k, mode='lines', line=line_marker)) layout=go.Layout( title='Wireframe Plot', scene=dict( xaxis=dict( gridcolor='rgb(255, 255, 255)', zerolinecolor='rgb(255, 255, 255)', showbackground=True, backgroundcolor='rgb(230, 230,230)' ), yaxis=dict( gridcolor='rgb(255, 255, 255)', zerolinecolor='rgb(255, 255, 255)', showbackground=True, backgroundcolor='rgb(230, 230,230)' ), zaxis=dict( gridcolor='rgb(255, 255, 255)', zerolinecolor='rgb(255, 255, 255)', showbackground=True, backgroundcolor='rgb(230, 230,230)' ) ), showlegend=False, ) fig=go.Figure(data=lines, layout=layout) py.iplot(fig, filename='wireframe_plot')

Reference

See https://plot.ly/python/reference/#scatter3d for more information!

fromIPython.displayimportdisplay, HTMLdisplay(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700" rel="stylesheet" type="text/css" />')) display(HTML('<link rel="stylesheet" type="text/css" href="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">')) ! pipinstallgit+https://github.com/plotly/publisher.git--upgradeimportpublisherpublisher.publish( '3d-wireframe.ipynb', 'python/3d-wireframe-plots/', 'Python Wireframe Plots | plotly', 'How to make wireframe plots in Python', title='3D Wireframe Plots in Python | plotly', name='3D Wireframe Plots', has_thumbnail='true', thumbnail='thumbnail/wireframe.jpg', language='python', display_as='3d_charts', order=8, ipynb='~notebook_demo/68')
close