Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite41bc91

Browse files
Merge branch 'master' into v4.3-docs
2 parents1aa14f0 +32d2bcf commite41bc91

14 files changed

+189
-173
lines changed

‎apidoc/_static/plotly-style.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,19 @@
1111
.body {
1212
font-family:"Open Sans", sans-serif;
1313
}
14+
.navbar-brandimg {
15+
height:30px;
16+
margin-top:4px;
17+
}
18+
19+
.navbar .container {
20+
padding-top:8px;
21+
}
22+
23+
a {
24+
color:#2391fe!important;
25+
}
26+
27+
code {
28+
color:#2391fe!important;
29+
}

‎apidoc/_templates/class_figure.rst

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@
44

55
..currentmodule::{{ module }}
66

7-
..autoclass::{{ objname }}
7+
..autosummary::
8+
:toctree: generated/
9+
10+
Figure
811

12+
Figure.show
13+
Figure.add_traces
14+
Figure.update_traces
15+
Figure.update_layout
16+
17+
18+
..autoclass::{{ objname }}
919
{% block methods %}
1020
..automethod::__init__
11-
..automethod::show
12-
..automethod::update_layout
13-
..automethod::add_traces
1421
{% endblock %}
1522

16-
Other methods
17-
{{ underline }}==============
18-
19-
..autosummary::
20-
:toctree: generated/
21-
22-
plotly.graph_objects.{{ objname }}
2323

24+
..autoclass::{{ objname }}
25+
:members:
26+
:inherited-members:
2427

2528
..raw::html
2629

2730
<divclass="clearer"></div>
31+

‎apidoc/_templates/trace.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:mod:`{{module}}`.{{objname}}
2-
{{ underline }}
2+
{{ underline }}============================
33

44

55
..currentmodule::{{ module }}
@@ -12,7 +12,7 @@
1212

1313

1414
:mod:`{{module}}`.{{objname.lower()}}
15-
{{ underline }}
15+
{{ underline }}================================
1616

1717
..autosummary::
1818

‎apidoc/figure.rst

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎apidoc/index.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
plotly API reference
6+
Python API reference for `plotly`
77
====================
88

99
This is the reference of plotly's API. Also see `plotly's documentation website<https://plot.ly/python>`_.
@@ -12,23 +12,23 @@ Submodules
1212
----------
1313

1414

15-
*:ref:`Plotlyexpress<px>`
16-
*:ref:`Graphobjects: figures, traces and layout<graph-objects>`
17-
*:ref:`Subplots<subplots>`
18-
*:ref:`FigureFactory<ff>`
19-
*:ref:`I/O<io>`
15+
*:ref:`PlotlyExpress: high-level interface for data visualization<px>`
16+
*:ref:`GraphObjects: low-level interface to figures, traces and layout<graph-objects>`
17+
*:ref:`Subplots: helper function for layout out multi-plot figures<subplots>`
18+
*:ref:`FigureFactories: helper methods for building specific complex charts<ff>`
19+
*:ref:`I/O: low-level interface for displaying, reading and writing figures<io>`
2020

2121
Full reference list
2222
-------------------
2323

2424
..toctree::
2525
:maxdepth:3
2626

27-
px.rst
28-
graph_objects.rst
29-
subplots.rst
30-
figure_factory.rst
31-
io.rst
27+
plotly.express.rst
28+
plotly.graph_objects.rst
29+
plotly.subplots.rst
30+
plotly.figure_factory.rst
31+
plotly.io.rst
3232

3333

3434

‎apidoc/px.rstrenamed to‎apidoc/plotly.express.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _px:
22

3-
Plotly express:`plotly.express`
3+
`plotly.express`: high-level interface for data visualization
44
================================
55

66
The `plotly.express<https://plot.ly/python/plotly-express/>`_ module is

‎apidoc/figure_factory.rstrenamed to‎apidoc/plotly.figure_factory.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _ff:
22

3-
Figure Factory
3+
`plotly.figure_factory`: helper methods for building specific complex charts
44
==============
55

66
..currentmodule::plotly.figure_factory
@@ -23,6 +23,6 @@ Figure Factory
2323
create_streamline
2424
create_table
2525
create_ternary_contour
26-
create_trisurf
26+
create_trisurf
2727
create_violin
2828

‎apidoc/graph_objects.rstrenamed to‎apidoc/plotly.graph_objects.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _graph-objects:
22

3-
Graph objects: figures, traces and layout
3+
`plotly.graph_objects`: low-level interface to figures, traces and layout
44
=========================================
55

66
..currentmodule::plotly.graph_objects
@@ -11,11 +11,14 @@ Graph objects: figures, traces and layout
1111

1212
>>> import plotly.graph_objects as go
1313

14-
..toctree::
15-
:maxdepth:1
16-
:caption:Figure:
14+
Figure
15+
------
16+
17+
..autosummary::
18+
:toctree: generated/
19+
:template: class_figure.rst
1720

18-
figure.rst
21+
Figure
1922

2023

2124
Layout

‎apidoc/io.rstrenamed to‎apidoc/plotly.io.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _io:
22

3-
I/O
3+
`plotly.io`: low-level interface for displaying, reading and writing figures
44
==============
55

66
..currentmodule::plotly.io

‎apidoc/subplots.rstrenamed to‎apidoc/plotly.subplots.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _subplots:
22

3-
Subplots:`plotly.subplots`
3+
`plotly.subplots`: helper function for laying out multi-plot figures
44
===========================
55

66
..currentmodule::plotly.subplots

‎python/3d-axes.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jupyter:
2020
name:python
2121
nbconvert_exporter:python
2222
pygments_lexer:ipython3
23-
version:3.6.7
23+
version:3.7.3
2424
plotly:
2525
description:How to format axes of 3d plots in Python with Plotly.
2626
display_as:3d_charts
@@ -207,3 +207,25 @@ fig.update_layout(scene = dict(
207207
)
208208
fig.show()
209209
```
210+
211+
###Disabling tooltip spikes
212+
213+
By default, guidelines originating from the tooltip point are drawn. It is possible to disable this behaviour with the`showspikes` parameter. In this example we only keep the`z` spikes (projection of the tooltip on the`x-y` plane). Hover on the data to show this behaviour.
214+
215+
```python
216+
import plotly.graph_objectsas go
217+
import numpyas np
218+
219+
N=50
220+
fig= go.Figure(data=[go.Mesh3d(x=(30*np.random.randn(N)),
221+
y=(25*np.random.randn(N)),
222+
z=(30*np.random.randn(N)),
223+
opacity=0.5,)])
224+
fig.update_layout(scene=dict(xaxis_showspikes=False,
225+
yaxis_showspikes=False))
226+
fig.show()
227+
```
228+
229+
```python
230+
231+
```

‎python/creating-and-updating-figures.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension:.md
77
format_name:markdown
88
format_version:'1.1'
9-
jupytext_version:1.1.6
9+
jupytext_version:1.1.1
1010
kernelspec:
1111
display_name:Python 3
1212
language:python
@@ -30,8 +30,8 @@ jupyter:
3030
page_type:example_index
3131
permalink:python/creating-and-updating-figures/
3232
redirect_from:
33-
-python/user-guide/
34-
-python/user-g/
33+
-python/user-guide/
34+
-python/user-g/
3535
thumbnail:thumbnail/creating-and-updating-figures.png
3636
---
3737

@@ -436,6 +436,23 @@ fig.update_traces(
436436
fig.show()
437437
```
438438

439+
###Overwrite existing properties when using update methods
440+
441+
`update_layout` and`update_traces` have an`overwrite` keyword argument, defaulting to False, in which case updates are applied recursively to the*existing* nested property structure. When set to True, the prior value of existing properties is overwritten with the provided value.
442+
443+
In the example below, the red color of markers is overwritten when updating`marker` in`update_traces` with`overwrite=True`. Note that setting instead`marker_opacity` with the magic underscore would not overwrite`marker_color` because properties would be overwritten starting only at the level of`marker.opacity`.
444+
445+
```python
446+
import plotly.graph_objectsas go
447+
fig= go.Figure(go.Bar(x=[1,2,3],y=[6,4,9],
448+
marker_color="red"))# will be overwritten below
449+
fig.update_traces(
450+
overwrite=True,
451+
marker={"opacity":0.4}
452+
)
453+
fig.show()
454+
```
455+
439456
####The for each trace method
440457
Suppose the updates that you want to make to a collection of traces depend on the current values of certain trace properties. The`update_traces` method cannot handle this situation, but the`for_each_trace` method can.
441458

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp