Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/python/3d-mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jupyter:
thumbnail: thumbnail/3d-mesh.jpg
---

### Simple 3D Mesh example ###
### Simple 3D Mesh Example

`go.Mesh3d` draws a 3D set of triangles with vertices given by `x`, `y` and `z`. If only coordinates are given, an algorithm such as [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used to draw the triangles. Otherwise the triangles can be given using the `i`, `j` and `k` parameters (see examples below).

Expand All @@ -49,7 +49,7 @@ fig = go.Figure(data=[go.Mesh3d(x=x, y=y, z=z, color='lightpink', opacity=0.50)]
fig.show()
```

### 3D Mesh example with Alphahull
### 3D Mesh Example with Alphahull


The `alphahull` parameter sets the shape of the mesh. If the value is -1 (default value) then [Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) is used. If >0 then the [alpha-shape algorithm](https://en.wikipedia.org/wiki/Alpha_shape) is used. If 0, the [convex hull](https://en.wikipedia.org/wiki/Convex_hull) is represented (resulting in a convex body).
Expand All @@ -72,7 +72,7 @@ fig.show()

[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.

Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash-enterprise/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**


```python hide_code=true
Expand Down Expand Up @@ -146,7 +146,7 @@ fig = go.Figure(data=[
fig.show()
```

### Intensity values defined on vertices or cells
### Intensity Values Defined on Vertices or Cells

The `intensitymode` attribute of `go.Mesh3d` can be set to `vertex` (default mode, in which case intensity values are interpolated between values defined on vertices), or to `cell` (value of the whole cell, no interpolation). Note that the `intensity` parameter should have the same length as the number of vertices or cells, depending on the `intensitymode`.

Expand Down
8 changes: 4 additions & 4 deletions doc/python/3d-scatter-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jupyter:
thumbnail: thumbnail/3d-scatter.jpg
---

## 3D scatter plot with Plotly Express
## 3D Scatter Plot with Plotly Express

[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on a variety of types of data](/python/px-arguments/) and produces [easy-to-style figures](/python/styling-plotly-express/).

Expand All @@ -57,7 +57,7 @@ fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width',
fig.show()
```

#### Style 3d scatter plot
#### Style 3D Scatter Plot

It is possible to customize the style of the figure through the parameters of `px.scatter_3d` for some options, or by updating the traces or the layout of the figure through `fig.update`.

Expand All @@ -73,11 +73,11 @@ fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
fig.show()
```

#### 3d scatter plots in Dash
#### 3D Scatter Plots in Dash

[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.

Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash-enterprise/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**


```python hide_code=true
Expand Down
8 changes: 4 additions & 4 deletions doc/python/animations.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jupyter:
thumbnail: thumbnail/animations.gif
---

#### Animated figures with Plotly Express
#### Animated Figures with Plotly Express

Several [Plotly Express](/python/plotly-express/) functions support the creation of animated figures through the `animation_frame` and `animation_group` arguments.

Expand All @@ -48,11 +48,11 @@ px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_gro
log_x=True, size_max=55, range_x=[100,100000], range_y=[25,90])
```

#### Animated figures in Dash
#### Animated Figures in Dash

[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.

Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash-enterprise/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**


```python hide_code=true
Expand Down Expand Up @@ -81,7 +81,7 @@ fig.show()
* Although Plotly Express supports animation for many chart and map types, smooth inter-frame transitions are today *only* possible for `scatter` and `bar`
* Plotly Express will *not* automatically compute the union of all x/y/color ranges, so these must be specified manually to avoid scale jumps across frames

#### Animated figures with Graph Objects
#### Animated Figures with Graph Objects

The remainder of this section describes the low-level [graph objects](/python/graph-objects/) API for constructing animated figures manually.

Expand Down
62 changes: 31 additions & 31 deletions doc/python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The axis type is auto-detected by looking at data from the first [trace](/python
* Both of these test an evenly-spaced sample of at most 1000 values


### Forcing an axis to be categorical
### Forcing an Axis to be Categorical

It is possible to force the axis type by setting explicitly `xaxis_type`. In the example below the automatic X axis type would be `linear` (because there are not more than twice as many unique strings as unique numbers) but we force it to be `category`.

Expand All @@ -91,7 +91,7 @@ The examples on this page apply to axes of any type, but extra attributes are av

#### Set and Style Axes Title Labels

##### Set axis title text with Plotly Express
##### Set Axis Title Text with Plotly Express

Axis titles are automatically set to the column names when [using Plotly Express with a data frame as input](/python/px-arguments/).

Expand Down Expand Up @@ -124,11 +124,11 @@ fig = px.bar(x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
fig.show()
```

##### Rotating tick labels in Dash
##### Rotating Tick Labels in Dash

[Dash](https://plotly.com/dash/) is the best way to build analytical apps in Python using Plotly figures. To run the app below, run `pip install dash`, click "Download" to get the code and run `python app.py`.

Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**
Get started with [the official Dash docs](https://dash.plotly.com/installation) and **learn how to effortlessly [style](https://plotly.com/dash/design-kit/) & publish apps like this with <a class="plotly-red" href="https://plotly.com/dash-enterprise/">Dash Enterprise</a> or <a class="plotly-red" href="https://plotly.com/cloud/">Plotly Cloud</a>.**


```python hide_code=true
Expand Down Expand Up @@ -173,7 +173,7 @@ fig.update_xaxes(labelalias=dict(Sat="Saturday", Sun="Sunday"))
fig.show()
```

##### Set axis title text with Graph Objects
##### Set Axis Title Text with Graph Objects

Axis titles are set using the nested `title.text` property of the x or y axis. Here is an example of creating a new figure and using `update_xaxes` and `update_yaxes`, with magic underscore notation, to set the axis titles.

Expand All @@ -188,7 +188,7 @@ fig.update_yaxes(title_text='Value A')
fig.show()
```

### Set axis title position
### Set Axis Title Position

This example sets `standoff` attribute to cartesian axes to determine the distance between the tick labels and the axis title. Note that the axis title position is always constrained within the margins, so the actual standoff distance is always less than the set or default value. By default [automargin](https://plotly.com/python/setting-graph-size/#automatically-adjust-margins) is `True` in Plotly template for the cartesian axis, so the margins will be pushed to fit the axis title at given standoff distance.

Expand All @@ -213,7 +213,7 @@ fig.update_yaxes(
fig.show()
```

##### Set axis title font
##### Set Axis Title Font

Here is an example that configures the font family, size, and color for the axis titles in a figure created using Plotly Express.

Expand All @@ -230,7 +230,7 @@ fig.show()

#### Tick Placement, Color, and Style

##### Toggling axis tick marks
##### Toggling Axis Tick Marks

Axis tick marks are disabled by default for the default `plotly` theme, but they can easily be turned on by setting the `ticks` axis property to `"inside"` (to place ticks inside plotting area) or `"outside"` (to place ticks outside the plotting area).

Expand All @@ -247,7 +247,7 @@ fig.update_yaxes(ticks="inside", col=1)
fig.show()
```

##### Set number of tick marks (and grid lines)
##### Set Number of Tick Marks (and Grid Lines)

The approximate number of ticks displayed for an axis can be specified using the `nticks` axis property.

Expand All @@ -263,7 +263,7 @@ fig.update_yaxes(nticks=20)
fig.show()
```

##### Set start position and distance between ticks
##### Set Start Position and Distance Between Ticks

The `tick0` and `dtick` axis properties can be used to control to placement of axis ticks as follows: If specified, a tick will fall exactly on the location of `tick0` and additional ticks will be added in both directions at intervals of `dtick`.

Expand All @@ -279,7 +279,7 @@ fig.update_yaxes(tick0=0.25, dtick=0.5)
fig.show()
```

##### Set exact location of axis ticks
##### Set Exact Location of Axis Ticks

It is possible to configure an axis to display ticks at a set of predefined locations by setting the `tickvals` property to an array of positions.

Expand All @@ -295,7 +295,7 @@ fig.update_yaxes(tickvals=[5.1, 5.9, 6.3, 7.5])
fig.show()
```

##### Style tick marks
##### Style Tick Marks

As discussed above, tick marks are disabled by default in the default `plotly` theme, but they can be enabled by setting the `ticks` axis property to `"inside"` (to place ticks inside plotting area) or `"outside"` (to place ticks outside the plotting area).

Expand All @@ -314,7 +314,7 @@ fig.update_yaxes(ticks="outside", tickwidth=2, tickcolor='crimson', ticklen=10,
fig.show()
```

##### Step for tick labels
##### Step for Tick Labels

*New in v5.6*

Expand All @@ -330,7 +330,7 @@ fig.update_yaxes(ticklabelstep=2)
fig.show()
```

##### Toggling axis labels
##### Toggling Axis Labels

The axis tick mark labels can be disabled by setting the `showticklabels` axis property to `False`.

Expand All @@ -347,7 +347,7 @@ fig.update_yaxes(showticklabels=False)
fig.show()
```

##### Set axis label rotation and font
##### Set Axis Label Rotation and Font

The orientation of the axis tick mark labels is configured using the `tickangle` axis property. The value of `tickangle` is the angle of rotation, in the clockwise direction, of the labels from vertical in units of degrees. The font family, size, and color for the tick labels are stored under the `tickfont` axis property.

Expand Down Expand Up @@ -426,7 +426,7 @@ fig.update_layout(title_text="Apple Stock Price")
fig.show()
```

#### Adding minor ticks
#### Adding Minor Ticks

_new in 5.8_

Expand Down Expand Up @@ -506,9 +506,9 @@ fig.update_layout(
fig.show()
```

### Axis lines: grid and zerolines
### Axis Lines: Grid and Zero Lines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camdecoster Zero line was styled inconsistently. Most instances in the repo are two words so this is the minimal change for consistency.


##### Toggling Axis grid lines
##### Toggling Axis Grid Lines

Axis grid lines can be disabled by setting the `showgrid` property to `False` for the x and/or y axis.

Expand All @@ -523,7 +523,7 @@ fig.update_yaxes(showgrid=False)
fig.show()
```

##### Toggling Axis zero lines
##### Toggling Axis Zero Lines

The lines passing through zero can be disabled as well by setting the `zeroline` axis property to `False`

Expand All @@ -537,9 +537,9 @@ fig.update_yaxes(showgrid=False, zeroline=False)
fig.show()
```

#### Styling and Coloring Axes and the Zero-Line
#### Styling and Coloring Axes and the Zero Line

##### Styling axis lines
##### Styling Axis Lines

The `showline` axis property controls the visibility of the axis line, and the `linecolor` and `linewidth` axis properties control the color and width of the axis line.

Expand All @@ -556,7 +556,7 @@ fig.update_yaxes(showline=True, linewidth=2, linecolor='black')
fig.show()
```

##### Mirroring axis lines
##### Mirroring Axis Lines

Axis lines can be mirrored to the opposite side of the plotting area by setting the `mirror` axis property to `True`.

Expand All @@ -573,7 +573,7 @@ fig.update_yaxes(showline=True, linewidth=2, linecolor='black', mirror=True)
fig.show()
```

##### Styling grid lines
##### Styling Grid Lines

The width and color of axis grid lines are controlled by the `gridwidth` and `gridcolor` axis properties.

Expand Down Expand Up @@ -604,7 +604,7 @@ fig.update_xaxes(gridcolor='black', griddash='dash', minor_griddash="dot")
fig.show()
```

##### Styling zero lines
##### Styling Zero Lines

The width and color of axis zero lines are controlled by the `zerolinewidth` and `zerolinecolor` axis properties.

Expand Down Expand Up @@ -689,7 +689,7 @@ fig.update_xaxes(insiderange=['2018-10-01', '2019-01-01'], title=dict(text="Date
fig.show()
```

#### Setting only a Lower or Upper Bound for Range
#### Setting Only a Lower or Upper Bound for Range

*New in 5.17*

Expand Down Expand Up @@ -767,7 +767,7 @@ fig.update_yaxes(
fig.show()
```

### Fixed Ratio Axes with Compressed domain
### Fixed Ratio Axes with Compressed Domain

If an axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), `constrain` determines how that happens: by increasing the "range" (default), or by decreasing the "domain".

Expand All @@ -794,7 +794,7 @@ fig.update_yaxes(
fig.show()
```

##### Decreasing the domain spanned by an axis
##### Decreasing the Domain Spanned by an Axis

In the example below, the x and y axis are anchored together, and the range of the `xaxis` is set manually. By default, plotly extends the range of the axis (overriding the `range` parameter) to fit in the figure `domain`. You can restrict the `domain` to force the axis to span only the set range, by setting `constrain='domain'` as below.

Expand Down Expand Up @@ -842,7 +842,7 @@ fig.update_yaxes(autorange="reversed")
fig.show()
```

#### Reversed Axes with Range ( Min/Max ) Specified
#### Reversed Axes with Range (Min/Max) Specified

The direction of an axis can be reversed when manually setting the range extents by specifying a list containing the upper bound followed by the lower bound (rather that the lower followed by the upper) as the `range` axis property.

Expand Down Expand Up @@ -888,7 +888,7 @@ fig.update_yaxes(range=[None, 3], autorange="max reversed")
fig.show()
```

### Axis range for log axis type
### Axis Range for Log Axis Type

If you are using a `log` type of axis and you want to set the range of the axis, you have to give the `log10` value of the bounds when using `fig.update_xaxes` or `fig.update_layout`. However, with `plotly.express` functions you pass directly the values of the range bounds (`plotly.express` then computes the appropriate values to pass to the figure layout).

Expand Down Expand Up @@ -928,7 +928,7 @@ fig.update_yaxes(domain=(0.25, 0.75))
fig.show()
```

#### Synchronizing axes in subplots with `matches`
#### Synchronizing Axes in Subplots with `matches`

Using `facet_col` from `plotly.express` let [zoom](https://help.plotly.com/zoom-pan-hover-controls/#step-3-zoom-in-and-zoom-out-autoscale-the-plot) and [pan](https://help.plotly.com/zoom-pan-hover-controls/#step-6-pan-along-axes) each facet to the same range implicitly. However, if the subplots are created with `make_subplots`, the axis needs to be updated with `matches` parameter to update all the subplots accordingly.

Expand Down Expand Up @@ -1008,7 +1008,7 @@ fig.update_xaxes(autorangeoptions=dict(clipmax=4))
fig.show()
```

##### Specify Values to be Included
##### Specify Values to Be Included

Use `autorangeoptions.include` to specify a value that should always be included within the calculated autorange. In this example, we specify that for the autorange calculated on the x-axis, 5 should be included.

Expand Down
Loading
Loading