You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before opening an issue, please search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/plotly/plotly.py/issues/new).
3
+
Before opening an issue, please search for existing and closed issues :)
4
4
5
-
Bug reports **must**be accompanied with a reproducible example. Please use the [latest version](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md) of plotly.py in your report unless not applicable and specify if you're plotting [online](https://plot.ly/python/getting-started/#initialization-for-online-plotting) or [offline](https://plot.ly/python/getting-started/#initialization-for-offline-plotting).
5
+
**Please**accompany bug reports with a reproducible example. Please use the [latest version](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md) of plotly.py in your report unless not applicable.
6
6
7
-
Note that GitHub issues are reserved for bug reports and feature requests only. Implementation questions should be asked on community.plot.ly (tagged [`python`](https://community.plot.ly/c/api/python)) or on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)).
8
-
9
-
Comments on GitHub issues or pull requests should add content to the discussions. Approbation comments such as *+1* or *I would like this feature to be implemented as well* will be deleted by the maintainers. Please use [GitHub reactions](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) instead.
7
+
Note that GitHub Issues are meant to be used for bug reports and feature requests only. Implementation or usage questions should be asked on [community.plotly.com](https://community.plotly.com/c/graphing-libraries/python/10) or on Stack Overflow (tagged [`plotly`](https://stackoverflow.com/questions/tagged/plotly)).
<img src="https://dash.plotly.com/assets/images/maintained-by-plotly.png" width="400px" alt="Maintained by Plotly">
37
+
</a>
38
+
</div>
35
39
36
-
Our recommended IDE for Plotly’s Python graphing library is Dash Enterprise’s [Data Science Workspaces](https://plotly.com/dash/workspaces/), which has both Jupyter notebook and Python code file support.
37
40
38
41
## Quickstart
39
42
40
-
`pip install plotly==5.2.2`
43
+
`pip install plotly==5.23.0`
41
44
42
45
Inside [Jupyter](https://jupyter.org/install) (installable with `pip install "jupyterlab>=3" "ipywidgets>=7.6"`):
43
46
44
47
```python
45
-
import plotly.graph_objects as go
46
-
fig = go.Figure()
47
-
fig.add_trace(go.Scatter(y=[2, 1, 4, 3]))
48
-
fig.add_trace(go.Bar(y=[1, 4, 3, 2]))
49
-
fig.update_layout(title='Hello Figure')
48
+
import plotly.express as px
49
+
fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2])
50
50
fig.show()
51
51
```
52
52
53
-
See the [Python documentation](https://plot.ly/python/) for more examples.
53
+
See the [Python documentation](https://plotly.com/python/) for more examples.
54
54
55
-
Read about what's new in [plotly.py v4](https://medium.com/plotly/plotly-py-4-0-is-here-offline-only-express-first-displayable-anywhere-fc444e5659ee)
56
55
57
56
## Overview
58
57
59
-
[plotly.py](https://plot.ly/python) is an interactive, open-source, and browser-based graphing library for Python :sparkles:
58
+
[plotly.py](https://plotly.com/python/) is an interactive, open-source, and browser-based graphing library for Python :sparkles:
60
59
61
60
Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is a high-level, declarative charting library. plotly.js ships with over 30 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more.
62
61
63
-
`plotly.py` is [MIT Licensed](packages/python/chart-studio/LICENSE.txt). Plotly graphs can be viewed in Jupyter notebooks, standalone HTML files, or hosted online using [Chart Studio Cloud](https://chart-studio.plot.ly/feed/).
62
+
`plotly.py` is [MIT Licensed](https://github.com/plotly/plotly.py/blob/master/LICENSE.txt). Plotly graphs can be viewed in Jupyter notebooks, standalone HTML files, or integrated into [Dash applications](https://dash.plotly.com/).
64
63
65
-
[Contact us](https://plot.ly/products/consulting-and-oem/) for consulting, dashboard development, application integration, and feature additions.
64
+
[Contact us](https://plotly.com/consulting-and-oem/) for consulting, dashboard development, application integration, and feature additions.
@@ -86,13 +85,13 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
86
85
plotly.py may be installed using pip...
87
86
88
87
```
89
-
pip install plotly==5.2.2
88
+
pip install plotly==5.23.0
90
89
```
91
90
92
91
or conda.
93
92
94
93
```
95
-
conda install -c plotly plotly=5.2.2
94
+
conda install -c plotly plotly=5.23.0
96
95
```
97
96
98
97
### JupyterLab Support
@@ -101,20 +100,20 @@ For use in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), install t
101
100
packages using `pip`:
102
101
103
102
```
104
-
$ pip install "jupyterlab>=3" "ipywidgets>=7.6"
103
+
pip install "jupyterlab>=3" "ipywidgets>=7.6"
105
104
```
106
105
107
106
or `conda`:
108
107
109
108
```
110
-
$ conda install "jupyterlab>=3" "ipywidgets>=7.6"
109
+
conda install "jupyterlab>=3" "ipywidgets>=7.6"
111
110
```
112
111
113
112
The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**, run the following commands to install the required JupyterLab extensions (note that this will require [`node`](https://nodejs.org/) to be installed):
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
@@ -147,13 +146,13 @@ The [`kaleido`](https://github.com/plotly/Kaleido) package has no dependencies a
147
146
using pip...
148
147
149
148
```
150
-
$ pip install -U kaleido
149
+
pip install -U kaleido
151
150
```
152
151
153
152
or conda.
154
153
155
154
```
156
-
$ conda install -c conda-forge python-kaleido
155
+
conda install -c conda-forge python-kaleido
157
156
```
158
157
159
158
#### Orca
@@ -195,31 +194,17 @@ or conda
195
194
conda install -c plotly plotly-geo=1.0.0
196
195
```
197
196
198
-
### Chart Studio support
199
-
200
-
The `chart-studio` package can be used to upload plotly figures to Plotly's Chart
201
-
Studio Cloud or On-Prem service. This package can be installed using pip...
202
-
203
-
```
204
-
pip install chart-studio==1.1.0
205
-
```
206
-
207
-
or conda
208
-
209
-
```
210
-
conda install -c plotly chart-studio=1.1.0
211
-
```
212
-
213
197
## Migration
214
198
215
-
If you're migrating from plotly.py v3 to v4, please check out the [Version 4 migration guide](https://plot.ly/python/next/v4-migration/)
199
+
If you're migrating from plotly.py v3 to v4, please check out the [Version 4 migration guide](https://plotly.com/python/v4-migration/)
216
200
217
-
If you're migrating from plotly.py v2 to v3, please check out the [Version 3 migration guide](migration-guide.md)
201
+
If you're migrating from plotly.py v2 to v3, please check out the [Version 3 migration guide](https://github.com/plotly/plotly.py/blob/master/migration-guide.md)
218
202
219
203
## Copyright and Licenses
220
204
221
205
Code and documentation copyright 2019 Plotly, Inc.
222
206
223
-
Code released under the [MIT license](packages/python/chart-studio/LICENSE.txt).
207
+
Code released under the [MIT license](https://github.com/plotly/plotly.py/blob/master/LICENSE.txt).
224
208
225
209
Docs released under the [Creative Commons license](https://github.com/plotly/documentation/blob/source/LICENSE).
Copy file name to clipboardExpand all lines: contributing.md
+38-13
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,12 @@ contribution.
9
9
10
10
## Code of Conduct
11
11
12
-
Please check out the [Code of Conduct](CODE_OF_CONDUCT.md). Don't tl:dr; it,
12
+
Please check out the [Code of Conduct](CODE_OF_CONDUCT.md). Don't skip it,
13
13
but the general idea is to be nice.
14
14
15
15
## What are the different ways to contribute?
16
16
17
-
There are many ways to contribute to plotly.py. It helps to understand first
18
-
the structure of the code and of the repository.
17
+
There are many ways to contribute to plotly.py. To contribute effectively, it is important to first gain an understanding of the structure of the code and of the repository.
19
18
20
19
-[the `plotly.graph_objects` module](https://plotly.com/python/graph-objects/) (usually imported as `go`)
21
20
is [generated from the Plotly.js schema](https://plotly.com/python/figure-structure/),
@@ -24,7 +23,7 @@ the structure of the code and of the repository.
24
23
in `packages/python/plotly/codegen`. Most of the codegen code concerns the generation of docstrings from
25
24
the schema JSON in Plotly.js. Traces and
26
25
Layout classes have a direct correspondence with their Javascript
27
-
counterpart. Higher-level methods that work on on figures regardless of the current schema (e.g., `BaseFigure.for_each_trace`) are defined in `packages/python/plotly/plotly/basedatatypes.py`. Additional helper methods are defined there for the `Figure` object, such as
26
+
counterpart. Higher-level methods that work on figures regardless of the current schema (e.g., `BaseFigure.for_each_trace`) are defined in `packages/python/plotly/plotly/basedatatypes.py`. Additional helper methods are defined there for the `Figure` object, such as
28
27
`update_layout`, `add_trace`, etc.
29
28
30
29
-[the `plotly.express` module](https://plotly.com/python/plotly-express/) (usually imported as `px`) is a high-level
@@ -126,13 +125,16 @@ learn and become confident about git, like http://try.github.io/.
126
125
127
126
### Create a virtual environment for plotly development
128
127
129
-
You can use either [conda][conda-env] or [virtualenv][virtualenv] to create a virtual environment for plotly development, e.g.
128
+
You can use either [conda][conda-env] or [virtualenv][virtualenv] to create a virtual environment for plotly development, e.g.:
130
129
131
130
```bash
132
-
conda create -n plotly-dev python
131
+
conda create -n plotly-dev python=3.11
133
132
conda activate plotly-dev
134
133
```
135
134
135
+
As of May 2024 our dependencies have been tested against Python versions 3.8 to 3.11.
136
+
We will support Python 3.12 and higher versions soon.
@@ -225,7 +227,30 @@ the `plotly/plotly.js` GitHub repository (and place them in
225
227
`plotly/package_data`). It will then regenerate all of the `graph_objs`
226
228
classes based on the new schema.
227
229
228
-
For dev branches, it is also possible to use `updateplotlyjsdev --devrepo reponame --devbranch branchname` to update to development versions of `plotly.js`. This will fetch the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`. If `--devrepo` or `--devbranch` are omitted, `updateplotlyjsdev` defaults using `plotly/plotly.js` and `master` respectively.
230
+
For dev branches, it is also possible to use `updateplotlyjsdev` in two configurations:
231
+
232
+
### CircleCI Release
233
+
234
+
If your devbranch is part of the official plotly.js repository, you can use
to update to development versions of `plotly.js`. This will fetch the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`. If `--devrepo` or `--devbranch` are omitted, `updateplotlyjsdev` defaults using `plotly/plotly.js` and `master` respectively.
239
+
240
+
### Local Repository
241
+
242
+
If you have a local repository of `plotly.js` you'd like to try, you can run:
243
+
244
+
```bash
245
+
# In your plotly.js/ directory, prepare the package:
246
+
247
+
$ npm run build
248
+
$ npm pack
249
+
$ mv plotly.js-*.tgz plotly.js.tgz
250
+
251
+
# In your plotly.py/packages/python/plotly/ directory:
Running tests with tox is much more powerful, but requires a bit more setup.
274
299
275
-
You'll need to export an environment variable for *each* tox environment you wish to test with. For example, if you want to test with `Python 2.7` and
300
+
You'll need to export an environment variable for *each* tox environment you wish to test with. For example, if you want to test with `Python 3.9` and
276
301
`Python 3.6`, but only care to check the `core` specs, you would need to ensure that the following variables are exported:
277
302
278
303
```
279
-
export PLOTLY_TOX_PYTHON_27=<python binary>
304
+
export PLOTLY_TOX_PYTHON_39=<python binary>
280
305
export PLOTLY_TOX_PYTHON_36=<python binary>
281
306
```
282
307
@@ -287,15 +312,15 @@ Where the `<python binary` is going to be specific to your development setup. As
287
312
# tox envs #
288
313
############
289
314
290
-
exportPLOTLY_TOX_PYTHON_27=python2.7
291
-
exportPLOTLY_TOX_PYTHON_34=python3.4
292
-
export TOXENV=py27-core,py34-core
315
+
exportPLOTLY_TOX_PYTHON_39=python3.9
316
+
exportPLOTLY_TOX_PYTHON_36=python3.6
317
+
export TOXENV=py39-core,py36-core
293
318
```
294
319
295
320
Where `TOXENV` is the environment list you want to use when invoking `tox` from the command line. Note that the `PLOTLY_TOX_*` pattern is used to pass in variables for use in the `tox.ini` file. Though this is a little setup, intensive, you'll get the following benefits:
296
321
297
322
*`tox` will automatically manage a virtual env for each environment you want to test in.
298
-
* You only have to run `tox` and know that the module is working in both `Python 2` and `Python 3`.
323
+
* You only have to run `tox` and know that the module is working in all included Python versions.
299
324
300
325
Finally, `tox` allows you to pass in additional command line arguments that are formatted in (by us) in the `tox.ini` file, see `{posargs}`. This is setup to help with our configuration of [pytest markers](http://doc.pytest.org/en/latest/example/markers.html), which are set up in `packages/python/plotly/pytest.ini`. To run only tests that are *not* tagged with `nodev`, you could use the following command:
Copy file name to clipboardExpand all lines: doc/README.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,11 @@ Checklist
65
65
66
66
### Build process
67
67
68
-
Run `make` to build html pages for the tutorials. This uses `jupytext` to
68
+
This build process requries a free personal public mapbox token to work.
69
+
70
+
First, create an account at https://account.mapbox.com/auth/signup Once that is done, navigate to https://account.mapbox.com/ and copy your "Default public token" to the file `doc/python/.mapbox_token`
71
+
72
+
Next, run `make` to build html pages for the tutorials. This uses `jupytext` to
69
73
execute the notebooks and `nbconvert` to convert notebook files to static html
70
74
pages. Note that the CI will build the doc, so you don't have to build it
71
75
yourself, it is enough to check that the markdown file runs correctly in
0 commit comments