Skip to content

Latest commit

 

History

History
89 lines (75 loc) · 2.59 KB

insets.md

File metadata and controls

89 lines (75 loc) · 2.59 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_aslanguagelayoutnameorderpage_typepermalinkthumbnail
How to make an inset graph in python.
multiple_axes
python
base
Inset Plots
3
example_index
python/insets/
thumbnail/insets.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!

Simple Inset Graph

importplotly.plotlyaspyimportplotly.graph_objsasgotrace1=go.Scatter( x=[1, 2, 3], y=[4, 3, 2] ) trace2=go.Scatter( x=[20, 30, 40], y=[30, 40, 50], xaxis='x2', yaxis='y2' ) data= [trace1, trace2] layout=go.Layout( xaxis2=dict( domain=[0.6, 0.95], anchor='y2' ), yaxis2=dict( domain=[0.6, 0.95], anchor='x2' ) ) fig=go.Figure(data=data, layout=layout) py.iplot(fig, filename='simple-inset')

Reference

See https://plot.ly/python/reference/#layout-scene for more information and chart attribute options!

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( 'inset.ipynb', 'python/insets/', 'Inset Plots | plotly', 'How to make an inset graph in python.', title='Inset Plots | plotly', name='Inset Plots', has_thumbnail='true', thumbnail='thumbnail/insets.jpg', language='python', page_type='example_index', display_as='multiple_axes', order=3)
close