Skip to content

Doc prod merge #2075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bc9a78a
trigger documentation deployment automatically
nicolaskruchten Dec 27, 2019
8b9adcf
trigger documentation deployment automatically
nicolaskruchten Dec 27, 2019
078bdc9
trigger documentation deployment automatically
nicolaskruchten Dec 27, 2019
b089d6a
undoing previous attempt
nicolaskruchten Dec 27, 2019
eb47ba2
trying to coordinate multi-repo CI jobs with a machine user
nicolaskruchten Dec 28, 2019
b6932d5
nicer commit messages all around
nicolaskruchten Dec 28, 2019
3ce7998
Add an example with `constrain='domain'` (#2025)
jingw222 Jan 1, 2020
91efa11
Fix a typo: remove duplicate word "the" (#2031)
WenjieZ Jan 5, 2020
0281146
Add some comments about the configuration of the legend (#2032)
WenjieZ Jan 6, 2020
40b652a
fix CI by disabling test
nicolaskruchten Jan 7, 2020
046040c
Merge pull request #2043 from plotly/fix_doc_ci
nicolaskruchten Jan 7, 2020
db87dda
revamp continuous color docs, add categorical color docs
nicolaskruchten Jan 4, 2020
94bef10
addressing PR comments
nicolaskruchten Jan 7, 2020
e9117dd
categorical to discrete
nicolaskruchten Jan 8, 2020
277b9c9
Merge pull request #2030 from plotly/colordocs
nicolaskruchten Jan 8, 2020
d0afda3
document configuration setting plotly.io.orca.config.server_url
antoinerg Jan 6, 2020
9494dc7
fixup
nicolaskruchten Jan 8, 2020
3e74b3a
Update scattermapbox.md
nicolaskruchten Jan 9, 2020
fd2a6cc
Merge pull request #2036 from plotly/doc-external-orca
antoinerg Jan 13, 2020
ea3882e
Added missing dependency to make cell standalone (#2069)
emmanuelle Jan 15, 2020
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
44 changes: 21 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ jobs:
- run:
name: Install tox
command: "sudo pip install tox"
- run:
name: Install npm dependencies
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: "cd packages/python/plotly; tox -e py27-optional"
Expand All @@ -143,10 +139,6 @@ jobs:
- run:
name: Install tox
command: "sudo pip install tox"
- run:
name: Install npm dependencies
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: "cd packages/python/plotly; tox -e py35-optional"
Expand All @@ -163,10 +155,6 @@ jobs:
- run:
name: Install tox
command: "sudo pip install tox"
- run:
name: Install npm dependencies
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: "cd packages/python/plotly; tox -e py36-optional"
Expand All @@ -183,10 +171,6 @@ jobs:
- run:
name: Install tox
command: "sudo pip install tox"
- run:
name: Install npm dependencies
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: "cd packages/python/plotly; tox -e py37-optional"
Expand Down Expand Up @@ -397,7 +381,7 @@ jobs:
steps:
- add_ssh_keys:
fingerprints:
- "3e:4b:19:1c:c2:d1:92:dd:bf:f8:c9:d6:a6:78:69:2a"
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot

- checkout

Expand Down Expand Up @@ -447,10 +431,10 @@ jobs:
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
cd build/html
git init
git config user.name nicolaskruchten
git config user.email nicolas@plot.ly
git config user.name plotlydocbot
git config user.email accounts@plot.ly
git add *
git commit -m build
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
git push --force [email protected]:plotly/plotly.py-docs.git master:built
rm -rf .git
cd ../..
Expand All @@ -459,6 +443,20 @@ jobs:
rm -rf build/html build/ipynb
cd ..

- run:
name: trigger doc build
command: |
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
git clone --depth=1 --branch=source-design-merge https://github.com/plotly/documentation.git
cd documentation
git config user.name plotlydocbot
git config user.email [email protected]
git commit --allow-empty -m "deploying https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
git push
cd ..
rm -rf documentation
fi

- run:
name: make doc
command: |
Expand All @@ -470,11 +468,11 @@ jobs:
cd _build/html
touch .nojekyll
git init
git config user.name emmanuelle
git config user.email emma@plot.ly
git config user.name plotlydocbot
git config user.email accounts@plot.ly
git add *
git add .nojekyll
git commit -m build
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
git push --force [email protected]:plotly/plotly.py-docs.git master:gh-pages
rm -rf .git
cd ../..
Expand Down
2 changes: 2 additions & 0 deletions doc/python/3d-mesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ fig.show()

```python
import plotly.graph_objects as go
import numpy as np

fig = go.Figure(data=[
go.Mesh3d(
# 8 vertices of a cube
Expand Down
33 changes: 32 additions & 1 deletion doc/python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,37 @@ fig.update_layout(
fig.show()
```

### 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".

```python
import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Scatter(
x = [0,1,1,0,0,1,1,2,2,3,3,2,2,3],
y = [0,0,1,1,3,3,2,2,3,3,1,1,0,0]
))

fig.update_layout(
width = 800,
height = 500,
title = "fixed-ratio axes with compressed axes",
xaxis = dict(
range=[-1,4], # sets the range of xaxis
constrain="domain", # meanwhile compresses the xaxis by decreasing its "domain"
),
yaxis = dict(
scaleanchor = "x",
scaleratio = 1,
),
)

fig.show()
```

#### Reversed Axes

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"`.
Expand Down Expand Up @@ -517,7 +548,7 @@ fig.show()

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

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.
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.

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.

Expand Down
41 changes: 27 additions & 14 deletions doc/python/builtin-colorscales.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.2'
format_version: "1.2"
jupytext_version: 1.3.1
kernelspec:
display_name: Python 3
Expand All @@ -22,34 +22,39 @@ jupyter:
pygments_lexer: ipython3
version: 3.6.8
plotly:
description: A reference for the built-in named continuous (sequential, diverging
and cylclical) colorscales in Plotly.
description:
A reference for the built-in named continuous (sequential, diverging
and cylclical) color scales in Plotly.
display_as: file_settings
has_thumbnail: true
ipynb: ~notebook_demo/187
language: python
layout: base
name: Built-in Continuous Colorscales
name: Built-in Continuous Color Scales
order: 27
permalink: python/builtin-colorscales/
thumbnail: thumbnail/heatmap_colorscale.jpg
v4upgrade: true
---

### Using Built-In Colorscales
### Using Built-In Continuous Color Scales

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

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

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

### Named Built-In Colorscales
### Discrete Color Sequences

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.

### Named Built-In Continuous Color Scales

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

### Built-In Sequential Colorscales
Built-in color scales are stored as lists of CSS colors:

```python
import plotly.express as px

print(px.colors.sequential.Plasma)
```

### Built-In Sequential Color scales

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).

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

### Built-In Diverging Colorscales
### Built-In Diverging Color scales

A collection of predefined diverging colorscales is provided in the `plotly.colors.diverging` module.
A collection of predefined diverging color scales is provided in the `plotly.colors.diverging` module.
Diverging color scales are appropriate for continuous data that has a natural midpoint
other otherwise informative special value, such as 0 altitude, or the boiling point
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).
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).

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

Expand All @@ -94,9 +107,9 @@ fig = px.colors.diverging.swatches()
fig.show()
```

### Built-In Cyclical Colorscales
### Built-In Cyclical Color scales

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