-
Notifications
You must be signed in to change notification settings - Fork 1
Getting started section #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
notebooks/getting-started.md
Outdated
<br> | ||
and set your credentials: | ||
## Overview | ||
The plotly Python library ([plotly.py](https://plot.ly/python/)) is an interactive, [open-source](https://github.com/plotly/plotly.py) plotting library that supports over 30 unique chart types covering a wide range of statistical, financial, geographic, scientific, and 3-dimensional use-cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
40 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, right!
"stream_ids": ["ylosqsyet5", "h2ct8btk1s", "oxz4fm883b"], | ||
"api_key": "lr1c37zw81" | ||
} | ||
$ pip install plotly==4.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is bound to evolve, why not pip install -U plotly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trouble is the JupyterLab section down below. The python and jupyterlab plotly extensions have to have versions that line up, and the package managers can't help with that.
We haven't talked through the whole workflow yet, but I was thinking we were going to rebuild the docs for each release, and so I though updating these versions at that point wouldn't be a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, the Dash User Guide does this as well. https://dash.plot.ly/installation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolaskruchten Do you have thoughts on including version constraints here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's go with absolute versions for now I guess. will be a pain and we will automate someday :)
sharing='private') | ||
import plotly.graph_objects as go | ||
fig = go.FigureWidget(data=go.Bar(y=[2, 3, 1])) | ||
fig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fig
or fig.show()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For FigureWidget
it needs to be fig
(or IPython.display.display
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK but if I copy and paste the code above in a jupyter notebook cell nothing is displayed, while if I write fig.show() the chart is displayed. I must be missing something ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 4.0.0a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classic notebook I assume? What do you get for jupyter nbextension list
?
|
||
By default all plots are set to **public**. Users with free account have the permission to keep one private plot. If you need to save private plots, [upgrade to a pro account](https://plot.ly/plans). If you're a [Personal or Professional user](https://plot.ly/settings/subscription/?modal=true&utm_source=api-docs&utm_medium=support-oss) and would like the default setting for your plots to be private, you can edit your Plotly configuration: | ||
This package contains everything you need to write figures to standalone HTML files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should include a blockquote with something like:
Note that no internet connection or account is required - this library is now "offline" by default.
In the past, this documentation emphasized publishing graphs to the https://plot.ly web service "Chart Studio". Publishing is now done with a separatechart_studio
package, see below for more details.
That wording could be cleaned up. cc @nicolaskruchten too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I added a note in 87ce12a.
```python | ||
import plotly | ||
help(plotly.offline.plot) | ||
$ pip install plotly-geo==1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why freeze the version number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plotly.py doesn't depend on plotly-geo
so if we add a new dataset to plotly-geo
and up the version then people won't automatically get it when they update the plotly
package. We will have runtime checks to catch it, but I guess my preference is to document the explicit compatible versions that the docs are built with.
See note above as well regarding the JupyterLab rationale, though that isn't as relevant to plotly-geo
.
### Using Plotly with Pandas | ||
### Chart Studio Support | ||
The `chart-studio` package can be used to upload plotly figures to Plotly's Chart | ||
Studio Cloud or On-Prem services. This package can be installed using pip... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```python | ||
from IPython.display import display, HTML | ||
## Where to next? | ||
Now that you have everything installed, you are ready to start reading and running examples of [basic charts](https://plot.ly/python/basic-charts/), [statistical charts](https://plot.ly/python/statistical-charts/), [scientific charts](https://plot.ly/python/scientific-charts/), [financial charts](https://plot.ly/python/#financial-charts), [geographic charts](https://plot.ly/python/maps/), and [3-dimensional charts](https://plot.ly/python/3d-charts/). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add a link to notebooks explaining how to configure figures, such as some of https://plot.ly/python/plotly-fundamentals/ (although this index page is quite misc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I added two more links in 8df26a3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a lot less misc now! The reorg PR went through so it's all actual fundamentals now... phew :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks !
notebooks/getting-started.md
Outdated
|
||
By default all plots are set to **public**. Users with free account have the permission to keep one private plot. If you need to save private plots, [upgrade to a pro account](https://plot.ly/plans). If you're a [Personal or Professional user](https://plot.ly/settings/subscription/?modal=true&utm_source=api-docs&utm_medium=support-oss) and would like the default setting for your plots to be private, you can edit your Plotly configuration: | ||
> Note: No internet connection or account is required to use plotly.py. Prior to version 4, this library could operate in either an "online" or "offline" mode. The documentation tended to emphasize the online mode, where graphs get published to the Chart Studio web service. In version 4, all "online" functionality was removed from the `plotly` package and is now available as the separate, optional, `chart-studio` package (See below). plotly.py version 4 is "offline" only, and does not include any functionality for uploading figures to cloud services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add "or payment"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and maybe bold the "no xxx required" and "not include any functionality for uploading figures to cloud services"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extend "uploading figures to" to "uploading figures or data to" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
plotly.py supports static image export using the `to_image` and `write_image` | ||
functions in the `plotly.io` package. This functionality requires the | ||
installation of the plotly [orca](https://github.com/plotly/orca) command line utility and the | ||
[`psutil`](https://github.com/giampaolo/psutil) and [`requests`](https://2.python-requests.org/en/master/) Python packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a note in blockquote saying something to the effect of "requests here is only used to make local requests within your machine and not to any outside services" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
notebooks/getting-started.md
Outdated
|
||
```python | ||
from IPython.display import display, HTML | ||
For information on configuring figure layout options (e.g. axes, titles, legends, etc) see [*Layout Options*](https://plot.ly/python/#layout-options). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should link to fundamentals now, and ditto the styling link below IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks for giving this a look @nicolaskruchten, I've incorporated your suggestions |
💃 |
This PR updates the "Getting started" page with updated detailed installation instructions and a "Where to next?" section with links out the the various categories of trace types, the creating and updating figures page, the renderers page, the theming page, the figure reference, and Dash.
@nicolaskruchten @emmanuelle
Doc upgrade checklist:
plot()
oriplot()
graph_objs
has been renamed tograph_objects
fig = <something>
call is high up in each exampletrace
objectsfig.show()
at the end of each examplev4upgrade: true
metadata added