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/axes.md
+16-19
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ jupyter:
5
5
text_representation:
6
6
extension: .md
7
7
format_name: markdown
8
-
format_version: '1.2'
8
+
format_version: "1.2"
9
9
jupytext_version: 1.3.0
10
10
kernelspec:
11
11
display_name: Python 3
@@ -22,7 +22,8 @@ jupyter:
22
22
pygments_lexer: ipython3
23
23
version: 3.7.3
24
24
plotly:
25
-
description: How to adjust axes properties in python. Includes examples of linear
25
+
description:
26
+
How to adjust axes properties in python. Includes examples of linear
26
27
and logarithmic axes, axes titles, styling and coloring axes and grid lines,
27
28
and more.
28
29
display_as: file_settings
@@ -34,23 +35,24 @@ jupyter:
34
35
thumbnail: thumbnail/axes.png
35
36
---
36
37
37
-
This tutorial explain how to set the properties of Cartesian axes, namely [`go.layout.XAxis`](/python/reference/#layout-xaxis) and [`go.layout.YAxis`](python/reference/#layout-xaxis). Other kinds of axes are described in other tutorials:
38
+
This tutorial explain how to set the properties of 2-dimensional Cartesian axes, namely [`go.layout.XAxis`](/python/reference/#layout-xaxis) and [`go.layout.YAxis`](python/reference/#layout-xaxis). Other kinds of axes are described in other tutorials:
39
+
38
40
-[3D axes](/python/3d-axes) The axis object is [`go.layout.Scene`](/python/reference/#layout-scene)
39
41
-[Polar axes](/python/polar-chart/). The axis object is [`go.layout.Polar`](/python/reference/#layout-polar)
40
42
-[Ternary axes](/python/ternary-plots). The axis object is [`go.layout.Ternary`](/python/reference/#layout-ternary)
41
-
-For Geo axes, see [this choropleth example](/python/choropleth-maps/#world-choropleth-map). The axis object is [`go.layout.Geo`](/python/reference/#layout-geo)
42
-
-For Mapbox axes, see the different mapbox tutorials in the [Maps page](/python/maps/). The axis object is [`go.layout.Mapbox`](/python/reference/#layout-mapbox)
43
-
- Color axes are described in the [color scales tutorial](/python/colorscales/).
43
+
-[Geo axes](/python/map-configuration/). The axis object is [`go.layout.Geo`](/python/reference/#layout-geo)
44
+
-[Mapbox axes](/python/mapbox-layers/). The axis object is [`go.layout.Mapbox`](/python/reference/#layout-mapbox)
45
+
-[Color axes](/python/colorscales/). The axis object is [`go.layout.Coloraxis`](/python/reference/#layout-coloraxis).
44
46
45
47
**See also** the tutorials on [subplots](/python/subplots) and [multiple axes](/python/multiple-axes/).
46
48
47
-
The different types of Cartesian axes are
49
+
The different types of Cartesian axes are
50
+
48
51
- 'linear'
49
52
- 'log' (see the [example below](#logarithmic-axes))
50
53
- 'date' (see the [tutorial on timeseries](/python/time-series/))
51
54
- 'category' (see for example [Bar Charts](/python/bar-charts/))
52
-
- 'multicategory' (see the [example below](#subcategory-(multicategory)-axes) ))
53
-
55
+
- 'multicategory' (see the [example below](<#subcategory-(multicategory)-axes>))
54
56
55
57
#### Logarithmic Axes
56
58
@@ -92,7 +94,7 @@ fig.show()
92
94
93
95
### Forcing an axis to be categorical
94
96
95
-
If you pass string values for the `x` or `y` parameter, plotly will automatically set the corresponding axis type to `category`, with the exception of string of numbers, in which case the axis is linear. It is however possible to force the axis type by setting explicitely `xaxis_type` to be `category`.
97
+
If you pass string values for the `x` or `y` parameter, plotly will automatically set the corresponding axis type to `category`, with the exception of string of numbers, in which case the axis is linear. It is however possible to force the axis type by setting explicitely `xaxis_type` to be `category`.
#### Toggling Axes Lines, Ticks, Labels, and Autorange
155
156
156
-
The different groups of Cartesian axes properties are
157
+
The different groups of Cartesian axes properties are
158
+
157
159
- tick values (locations of tick marks) and tick labels. Tick labels are placed at tick values.
158
160
- lines: grid lines (passing through tick values), axis lines, zero lines
159
161
- title of the axis
160
162
- range of the axis
161
163
- domain of the axis
162
164
163
-
164
165
#### Tick Placement, Color, and Style
165
166
166
167
##### Toggling axis tick marks
@@ -169,7 +170,6 @@ Axis tick marks are disabled by default for the default `plotly` theme, but they
169
170
170
171
Here is an example of turning on inside x-axis and y-axis ticks in a faceted figure created using Plotly Express. Note how the `col` argument to `update_yaxes` is used to only turn on the y-axis ticks for the left-most subplot.
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.
The `scaleanchor` and `scaleratio` axis properties can be used to force a fixed ratio of pixels per unit between two axes.
@@ -593,7 +590,7 @@ fig.show()
593
590
594
591
##### Decreasing the domain spanned by an axis
595
592
596
-
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.
593
+
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.
597
594
598
595
```python
599
596
import plotly.graph_objects as go
@@ -687,7 +684,7 @@ fig.show()
687
684
688
685
### Axis range for log axis type
689
686
690
-
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).
687
+
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).
Copy file name to clipboardExpand all lines: doc/python/bubble-maps.md
+4
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,10 @@ jupyter:
33
33
thumbnail: thumbnail/bubble-map.jpg
34
34
---
35
35
36
+
#### Base Map Configuration
37
+
38
+
Plotly figures made with `px.scatter_geo`, `px.line_geo` or `px.choropleth` functions or containing `go.Choropleth` or `go.Scattergeo` graph objects have a `go.layout.Geo` object which can be used to [control the appearance of the base map](/python/map-configuration/) onto which data is plotted.
39
+
36
40
### Bubble map with Plotly Express
37
41
38
42
[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly, which [operates on "tidy" data](/python/px-arguments/). With `px.scatter_geo`, each line of the dataframe is represented as a marker point. The column set as the `size` argument gives the size of markers.
0 commit comments