Skip to content

Commit 7a79302

Browse files
Merge pull request #2075 from plotly/doc-prod
Doc prod merge
2 parents 95cf2f1 + ea3882e commit 7a79302

12 files changed

+547
-57
lines changed

.circleci/config.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ jobs:
381381
steps:
382382
- add_ssh_keys:
383383
fingerprints:
384-
- "3e:4b:19:1c:c2:d1:92:dd:bf:f8:c9:d6:a6:78:69:2a"
384+
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot
385385

386386
- checkout
387387

@@ -431,10 +431,10 @@ jobs:
431431
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
432432
cd build/html
433433
git init
434-
git config user.name nicolaskruchten
435-
git config user.email nicolas@plot.ly
434+
git config user.name plotlydocbot
435+
git config user.email accounts@plot.ly
436436
git add *
437-
git commit -m build
437+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
438438
git push --force [email protected]:plotly/plotly.py-docs.git master:built
439439
rm -rf .git
440440
cd ../..
@@ -443,6 +443,20 @@ jobs:
443443
rm -rf build/html build/ipynb
444444
cd ..
445445
446+
- run:
447+
name: trigger doc build
448+
command: |
449+
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
450+
git clone --depth=1 --branch=source-design-merge https://github.com/plotly/documentation.git
451+
cd documentation
452+
git config user.name plotlydocbot
453+
git config user.email [email protected]
454+
git commit --allow-empty -m "deploying https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
455+
git push
456+
cd ..
457+
rm -rf documentation
458+
fi
459+
446460
- run:
447461
name: make doc
448462
command: |
@@ -454,11 +468,11 @@ jobs:
454468
cd _build/html
455469
touch .nojekyll
456470
git init
457-
git config user.name emmanuelle
458-
git config user.email emma@plot.ly
471+
git config user.name plotlydocbot
472+
git config user.email accounts@plot.ly
459473
git add *
460474
git add .nojekyll
461-
git commit -m build
475+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
462476
git push --force [email protected]:plotly/plotly.py-docs.git master:gh-pages
463477
rm -rf .git
464478
cd ../..

doc/python/3d-mesh.md

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ fig.show()
103103

104104
```python
105105
import plotly.graph_objects as go
106+
import numpy as np
107+
106108
fig = go.Figure(data=[
107109
go.Mesh3d(
108110
# 8 vertices of a cube

doc/python/axes.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,37 @@ fig.update_layout(
622622
fig.show()
623623
```
624624

625+
### Fixed Ratio Axes with Compressed domain
626+
627+
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".
628+
629+
```python
630+
import plotly.graph_objects as go
631+
632+
fig = go.Figure()
633+
634+
fig.add_trace(go.Scatter(
635+
x = [0,1,1,0,0,1,1,2,2,3,3,2,2,3],
636+
y = [0,0,1,1,3,3,2,2,3,3,1,1,0,0]
637+
))
638+
639+
fig.update_layout(
640+
width = 800,
641+
height = 500,
642+
title = "fixed-ratio axes with compressed axes",
643+
xaxis = dict(
644+
range=[-1,4], # sets the range of xaxis
645+
constrain="domain", # meanwhile compresses the xaxis by decreasing its "domain"
646+
),
647+
yaxis = dict(
648+
scaleanchor = "x",
649+
scaleratio = 1,
650+
),
651+
)
652+
653+
fig.show()
654+
```
655+
625656
#### Reversed Axes
626657

627658
You can tell plotly's automatic axis range calculation logic to reverse the direction of an axis by setting the `autorange` axis property to `"reversed"`.
@@ -682,7 +713,7 @@ fig.show()
682713

683714
The axis auto-range calculation logic can be configured using the `rangemode` axis parameter.
684715

685-
If `rangemode` is `"normal"` (the default), the range is computed based on the min and max values of the input data. If `"tozero"`, the the range will always include zero. If `"nonnegative"`, the range will not extend below zero, regardless of the input data.
716+
If `rangemode` is `"normal"` (the default), the range is computed based on the min and max values of the input data. If `"tozero"`, the range will always include zero. If `"nonnegative"`, the range will not extend below zero, regardless of the input data.
686717

687718
Here is an example of configuring a faceted scatter plot created using Plotly Express to always include zero for both the x and y axes.
688719

doc/python/builtin-colorscales.md

+27-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
8+
format_version: "1.2"
99
jupytext_version: 1.3.1
1010
kernelspec:
1111
display_name: Python 3
@@ -22,34 +22,39 @@ jupyter:
2222
pygments_lexer: ipython3
2323
version: 3.6.8
2424
plotly:
25-
description: A reference for the built-in named continuous (sequential, diverging
26-
and cylclical) colorscales in Plotly.
25+
description:
26+
A reference for the built-in named continuous (sequential, diverging
27+
and cylclical) color scales in Plotly.
2728
display_as: file_settings
2829
has_thumbnail: true
2930
ipynb: ~notebook_demo/187
3031
language: python
3132
layout: base
32-
name: Built-in Continuous Colorscales
33+
name: Built-in Continuous Color Scales
3334
order: 27
3435
permalink: python/builtin-colorscales/
3536
thumbnail: thumbnail/heatmap_colorscale.jpg
3637
v4upgrade: true
3738
---
3839

39-
### Using Built-In Colorscales
40+
### Using Built-In Continuous Color Scales
4041

4142
Many Plotly Express functions accept a `color_continuous_scale` argument and many trace
4243
types have a `colorscale` attribute in their schema. Plotly comes with a large number of
43-
built-in continuous colorscales, which can be referred to in Python code when setting the above arguments,
44+
built-in continuous color scales, which can be referred to in Python code when setting the above arguments,
4445
either by name in a case-insensitive string e.g. `px.scatter(continuous_color_scale="Viridis"`) or by reference e.g.
4546
`go.Scatter(marker_colorscale=plotly.colors.sequential.Viridis)`. They can also be reversed by adding `_r` at the end
4647
e.g. `"Viridis_r"` or `plotly.colors.sequential.Viridis_r`.
4748

4849
The `plotly.colours` module is also available under `plotly.express.colors` so you can refer to it as `px.colors`.
4950

50-
When using continuous colorscales, you will often want to [configure various aspects of its range and colorbar](/python/colorscales/).
51+
When using continuous color scales, you will often want to [configure various aspects of its range and colorbar](/python/colorscales/).
5152

52-
### Named Built-In Colorscales
53+
### Discrete Color Sequences
54+
55+
Plotly also comes with some built-in [discrete color sequences](/python/discrete-color/) which are _not intended_ to be used with the `color_continuous_scale` argument as they are not designed for interpolation to occur between adjacent colors.
56+
57+
### Named Built-In Continuous Color Scales
5358

5459
You can use any of the following names as string values to set `continuous_color_scale` or `colorscale` arguments.
5560
These strings are case-insensitive and you can append `_r` to them to reverse the order of the scale.
@@ -62,7 +67,15 @@ named_colorscales = px.colors.named_colorscales()
6267
print("\n".join(wrap("".join('{:<12}'.format(c) for c in named_colorscales), 96)))
6368
```
6469

65-
### Built-In Sequential Colorscales
70+
Built-in color scales are stored as lists of CSS colors:
71+
72+
```python
73+
import plotly.express as px
74+
75+
print(px.colors.sequential.Plasma)
76+
```
77+
78+
### Built-In Sequential Color scales
6679

6780
A collection of predefined sequential colorscales is provided in the `plotly.colors.sequential` module. Sequential color scales are appropriate for most continuous data, but in some cases it can be helpful to use a diverging or cyclical color scale (see below).
6881

@@ -78,12 +91,12 @@ fig.show()
7891
Note: `RdBu` was included in this module by mistake, even though it is a diverging color scale.
7992
It is intentionally left in for backwards-compatibility reasons.
8093

81-
### Built-In Diverging Colorscales
94+
### Built-In Diverging Color scales
8295

83-
A collection of predefined diverging colorscales is provided in the `plotly.colors.diverging` module.
96+
A collection of predefined diverging color scales is provided in the `plotly.colors.diverging` module.
8497
Diverging color scales are appropriate for continuous data that has a natural midpoint
8598
other otherwise informative special value, such as 0 altitude, or the boiling point
86-
of a liquid. These scales are intended to be used when [explicitly setting the midpoint of the scale](/python/colorscales/#setting-the-midpoint-of-a-diverging-colorscale).
99+
of a liquid. These scales are intended to be used when [explicitly setting the midpoint of the scale](/python/colorscales/#setting-the-midpoint-of-a-color-range-for-a-diverging-color-scale).
87100

88101
Here are all the built-in scales in the `plotly.colors.diverging` module:
89102

@@ -94,9 +107,9 @@ fig = px.colors.diverging.swatches()
94107
fig.show()
95108
```
96109

97-
### Built-In Cyclical Colorscales
110+
### Built-In Cyclical Color scales
98111

99-
A collection of predefined cyclical colorscales is provided in the `plotly.colors.cyclical` module.
112+
A collection of predefined cyclical color scales is provided in the `plotly.colors.cyclical` module.
100113
Cyclical color scales are appropriate for continuous data that has a natural cyclical
101114
structure, such as temporal data (hour of day, day of week, day of year, seasons) or
102115
complex numbers or other phase or angular data.

0 commit comments

Comments
 (0)