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
Copy file name to clipboardExpand all lines: doc/python/annotated-heatmap.md
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ jupyter:
36
36
37
37
#### Simple Annotated Heatmap
38
38
39
-
For more examples with Heatmaps, see [this page](/python/heatmaps/).
39
+
This page details the use of a [figure factory](/python/figure-factories/). For more examples with Heatmaps, see [this page](/python/heatmaps/).
40
40
41
41
```python
42
42
import plotly.figure_factory as ff
@@ -202,8 +202,5 @@ fig.show()
202
202
```
203
203
204
204
#### Reference
205
-
For more info on Plotly heatmaps, see: https://plotly.com/python/reference/#heatmap.<br> For more info on using colorscales with Plotly see: https://plotly.com/python/heatmap-and-contour-colorscales/ <br>For more info on annotated_heatmaps, see:
206
205
207
-
```python
208
-
help(ff.create_annotated_heatmap)
209
-
```
206
+
For more info on Plotly heatmaps, see: https://plotly.com/python/reference/#heatmap.<br> For more info on using colorscales with Plotly see: https://plotly.com/python/heatmap-and-contour-colorscales/ <br>For more info on `ff.create_annotated_heatmap()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_annotated_heatmap.html#plotly.figure_factory.create_annotated_heatmap)
Copy file name to clipboardExpand all lines: doc/python/county-choropleth.md
+1-8Lines changed: 1 addition & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ jupyter:
37
37
### Deprecation warning
38
38
39
39
40
-
This page describes a legacy "figure factory" method for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [Mapbox tile-based choropleth maps](/python/mapbox-county-choropleth).
40
+
This page describes a [legacy "figure factory" method](/python/figure-factories/) for creating map-like figures using [self-filled scatter traces](/python/shapes). **This is no longer the recommended way to make county-level choropleth maps**, instead we recommend using a [GeoJSON-based approach to making outline choropleth maps](/python/choropleth-maps/) or the alternative [Mapbox tile-based choropleth maps](/python/mapbox-county-choropleth).
41
41
42
42
43
43
#### Required Packages
@@ -274,10 +274,3 @@ fig.show()
274
274
```
275
275
276
276
Also see Mapbox county choropleths made in Python: [https://plotly.com/python/mapbox-county-choropleth/](https://plotly.com/python/mapbox-county-choropleth/)
Copy file name to clipboardExpand all lines: doc/python/creating-and-updating-figures.md
+26-26Lines changed: 26 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -39,9 +39,9 @@ jupyter:
39
39
40
40
### Representing Figures
41
41
42
-
The goal of the plotly.py package is to provide a pleasant Python interface for creating figure specifications which are displayed by the [plotly.js](https://plot.ly/javascript) JavaScript graphing library.
42
+
The goal of the plotly.py package is to provide a pleasant Python interface for creating figure specifications which are displayed by the [plotly.js](https://plot.ly/javascript) JavaScript graphing library.
43
43
44
-
In the context of the plotly.js library, a figure is specified by a declarative [JSON](https://www.json.org/json-en.html) data structure.
44
+
In the context of the plotly.js library, a figure is specified by a declarative [JSON](https://www.json.org/json-en.html) data structure.
45
45
46
46
Therefore, you should always keep in mind as you are creating and updating figures using the plotly.py package that its ultimate goal is to help users produce Python [dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) that can be automatically [serialized](https://en.wikipedia.org/wiki/Serialization) into the JSON data structure that the plotly.js graphing library understands.
47
47
@@ -63,21 +63,21 @@ import plotly.io as pio
63
63
pio.show(fig)
64
64
```
65
65
66
-
Let's take a closer look at structure of the `fig` dictionary in order to better understand how `plotly.py` figures are built.
66
+
Let's take a closer look at structure of the `fig` dictionary in order to better understand how `plotly.py` figures are built.
67
67
68
68
##### The `"data"` Key
69
69
70
70
The `"data"` key stores the value of list which describes the trace or traces which make up a figure. It is still a list even if the figure only contains one trace, as in the example above.
71
71
72
72
Each trace in the list stored by the `"data"` key is itself defined by a dictionary. The type of the trace (`"bar"`, `"scatter"`, `"contour"`, etc...) is specified with a `"type"` key, and the rest of the keys in a trace specification dictionary (`x`, `y`, etc...) are used to define the properties specific to the trace of that type.
73
73
74
-
##### The `"layout"` Key
74
+
##### The `"layout"` Key
75
75
76
76
The`"layout"` key stores a dictionary that specifies properties related to customizing how the figure looks, such as its title, typography, margins, axes, annotations, shapes, legend and more. In contrast to trace configuration options, which apply only to individual traces, layout configuration options apply to the figure as a whole.
77
77
78
78
The [_Full Reference_](https://plot.ly/python/reference/) page contains descriptions of all of the supported trace and layout attributes and configuration options.
79
79
80
-
If working from the _Full Reference_ to build figures as Python dictionaries and lists suites your needs, go for it!
80
+
If working from the _Full Reference_ to build figures as Python dictionaries and lists suites your needs, go for it!
81
81
82
82
This is a perfectly valid way to use `plotly.py` to build figures. On the other hand, if you would like to use an API that offers you a bit more assistance in the figure creation process, read on to learn about `graph objects`.
83
83
@@ -93,7 +93,7 @@ As an alternative to working with Python dictionaries, the `plotly.py` graphing
93
93
94
94
4. Graph objects support higher-level convenience functions for making updates to already constructed figures, as described below.
95
95
96
-
**Graph objects are stored in a hierarchy of modules under the `plotly.graph_objects` package, so make sure to remember to `import plotly.graph_objects as go` when you want to use them.**
96
+
**Graph objects are stored in a hierarchy of modules under the `plotly.graph_objects` package, so make sure to remember to `import plotly.graph_objects as go` when you want to use them.**
97
97
98
98
Below you can find an example of one way that the figure in the example above could be specified using a graph object instead of a dictionary.
99
99
@@ -148,11 +148,11 @@ print("\n\nJSON Representation of A Graph Object:\n" + str(fig.to_json()))
148
148
149
149
### Creating Figures
150
150
151
-
This section summarizes several ways to create new graph object figures with the `plotly.py` graphing library.
151
+
This section summarizes several ways to create new graph object figures with the `plotly.py` graphing library.
152
152
153
153
#### Constructor
154
154
155
-
As demonstrated above, you can build a complete figure by passing trace and layout specifications to the `plotly.graph_objects.Figure` constructor. These trace and layout specifications can be either dictionaries or graph objects.
155
+
As demonstrated above, you can build a complete figure by passing trace and layout specifications to the `plotly.graph_objects.Figure` constructor. These trace and layout specifications can be either dictionaries or graph objects.
156
156
157
157
In the following example, the traces are specified using graph objects and the layout is specified as a dictionary.
158
158
@@ -185,7 +185,7 @@ fig.show()
185
185
186
186
#### Figure Factories
187
187
188
-
Figure factories (included in `plotly.py` in the `plotly.figure_factory` module) are functions that produce graph object figures, often to satisfy the needs of specialized domains. Here's an example of using the `create_quiver()` figure factory to construct a graph object figure that displays a 2D quiver plot.
188
+
[Figure factories](/python/figure-factories) (included in `plotly.py` in the `plotly.figure_factory` module) are functions that produce graph object figures, often to satisfy the needs of specialized domains. Here's an example of using the `create_quiver()` figure factory to construct a graph object figure that displays a 2D quiver plot.
title="Adding Traces To Subplots Witin A Plotly Express Figure")
281
281
282
282
reference_line = go.Scatter(x=[2, 4],
@@ -294,7 +294,7 @@ fig.show()
294
294
295
295
#### Add Trace Convenience Methods
296
296
297
-
As an alternative to the `add_trace()` method, graph object figures have a family of methods of the form `add_{trace}` (where `{trace}` is the name of a trace type) for constructing and adding traces of each trace type.
297
+
As an alternative to the `add_trace()` method, graph object figures have a family of methods of the form `add_{trace}` (where `{trace}` is the name of a trace type) for constructing and adding traces of each trace type.
298
298
299
299
Here is the previous subplot example, adapted to add the scatter trace using `fig.add_scatter()` and to add the bar trace using `fig.add_bar()`.
300
300
@@ -311,11 +311,11 @@ fig.show()
311
311
312
312
#### Magic Underscore Notation
313
313
314
-
To make it easier to work with nested properties, graph object constructors and many graph object methods support magic underscore notation.
314
+
To make it easier to work with nested properties, graph object constructors and many graph object methods support magic underscore notation.
315
315
316
316
This allows you to reference nested properties by joining together multiple nested property names with underscores.
317
317
318
-
For example, specifying the figure title in the figure constructor _without_ magic underscore notation requires setting the `layout` argument to `dict(title=dict(text="A Chart"))`.
318
+
For example, specifying the figure title in the figure constructor _without_ magic underscore notation requires setting the `layout` argument to `dict(title=dict(text="A Chart"))`.
319
319
320
320
Similarly, setting the line color of a scatter trace requires setting the `marker` property to `dict(color="crimson")`.
321
321
@@ -349,7 +349,7 @@ Magic underscore notation is supported throughout the graph objects API, and it
349
349
350
350
#### Updating Figure Layouts
351
351
352
-
Graph object figures support an `update_layout()` method that may be used to update multiple nested properties of a figure's layout.
352
+
Graph object figures support an `update_layout()` method that may be used to update multiple nested properties of a figure's layout.
353
353
354
354
Here is an example of updating the text and font size of a figure's title using `update_layout()`.
Copy file name to clipboardExpand all lines: doc/python/dendrogram.md
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ jupyter:
35
35
36
36
#### Basic Dendrogram
37
37
38
-
A [dendrogram](https://en.wikipedia.org/wiki/Dendrogram) is a diagram representing a tree. The figure factory `create_dendrogram` performs [hierachical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) on data and represents the resulting tree. Values on the tree depth axis correspond to distances between clusters.
38
+
A [dendrogram](https://en.wikipedia.org/wiki/Dendrogram) is a diagram representing a tree. The [figure factory](/python/figure-factories/) called`create_dendrogram` performs [hierachical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering) on data and represents the resulting tree. Values on the tree depth axis correspond to distances between clusters.
39
39
40
40
Dendrogram plots are commonly used in computational biology to show the clustering of genes or samples, sometimes in the margin of heatmaps.
41
41
@@ -178,6 +178,4 @@ fig.show()
178
178
179
179
### Reference
180
180
181
-
```python
182
-
help(ff.create_dendrogram)
183
-
```
181
+
For more info on `ff.create_dendrogram()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_dendrogram.html)
Copy file name to clipboardExpand all lines: doc/python/distplot.md
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ fig.show()
58
58
59
59
## Combined statistical representations with distplot figure factory
60
60
61
-
The distplot figure factory displays a combination of statistical representations of numerical data, such as histogram, kernel density estimation or normal curve, and rug plot.
61
+
The distplot [figure factory](/python/figure-factories/) displays a combination of statistical representations of numerical data, such as histogram, kernel density estimation or normal curve, and rug plot.
62
62
63
63
#### Basic Distplot
64
64
@@ -286,6 +286,5 @@ fig.show()
286
286
287
287
#### Reference
288
288
289
-
```python
290
-
help(ff.create_distplot)
291
-
```
289
+
290
+
For more info on `ff.create_distplot()`, see the [full function reference](https://plotly.com/python-api-reference/generated/plotly.figure_factory.create_distplot.html)
Figure Factories are dedicated functions for creating very specific types of plots.
27
+
display_as: file_settings
28
+
language: python
29
+
layout: base
30
+
name: Figure Factories
31
+
order: 32
32
+
permalink: python/figure-factories/
33
+
thumbnail: thumbnail/streamline.jpg
34
+
---
35
+
36
+
#### `plotly.figure_factory`
37
+
38
+
The `plotly.figure_factory` module contains dedicated functions for creating very specific types of plots that were at the time of their creation difficult to create with `plotly.graph_objects` and prior to the existence of [Plotly Express](/python/plotly-express/). As new functionality gets added to [Plotly.js](https://plotly.com/javascript/) and to Plotly Express, certain Figure Factories become unecessary and are therefore deprecated as "legacy", but remain in the module for backwards-compatibility reasons.
39
+
40
+
The following types of plots are still difficult to create with Graph Objects or Plotly Express and therefore the corresponding Figure Factories are *not* deprecated:
*[County Choropleth Maps](/python/county-choropleth/), deprecated by regular [Choropleth maps with GeoJSON input](/python/choropleth-maps/)
54
+
*[Distplots](/python/distplot/), mostly deprecated by [`px.histogram`](/python/histograms/)
55
+
56
+
#### Reference
57
+
58
+
For more information about the contents of `plotly.figure_factory`, including deprecated methods, please refer to our [API Reference documentation](https://plotly.com/python-api-reference/plotly.figure_factory.html).
Copy file name to clipboardExpand all lines: doc/python/figure-factory-subplots.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,8 @@ jupyter:
34
34
---
35
35
36
36
#### Plotly's Figure Factory Module
37
-
Plotly's Python API contains a figure factory module which includes many wrapper functions that create unique chart types that are not yet included in [plotly.js](https://github.com/plotly/plotly.js), Plotly's open-source graphing library. The figure factory functions create a full figure, so some Plotly features, such as subplotting, should be implemented slightly differently with these charts.
37
+
38
+
Plotly's Python API contains a [figure factory module](/python/figure-factories/) which includes many wrapper functions that create unique chart types that are not yet included in [plotly.js](https://github.com/plotly/plotly.js), Plotly's open-source graphing library. The figure factory functions create a full figure, so some Plotly features, such as subplotting, should be implemented slightly differently with these charts.
0 commit comments