Skip to content
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

Doc prod- #2677

Merged
merged 25 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Binary file modified doc/apidoc/_static/favicon.ico
Binary file not shown.
Binary file modified doc/apidoc/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 70 additions & 24 deletions doc/apidoc/_static/plotly-style.css
Original file line number Diff line number Diff line change
@@ -1,60 +1,106 @@
.navbar-default {
background-color: #00004f;
background-color: #fff;
}
.navbar {
min-height: 75px;
border-bottom: 1px solid #e7e7e7;
}
.navbar-brand {
font-family: "Open Sans", sans-serif;
padding: 10px 10px;
font-family: "Open Sans", sans-serif;
padding: 10px 10px;
}

.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 0;
}

.body {
font-family: "Open Sans", sans-serif;
font-family: "Open Sans", sans-serif;
}

.navbar-brand img {
height: 30px;
margin-top: 4px;
height: 30px;
margin-top: 4px;
}

.navbar .container {
padding-top: 8px;
}

a {
color: #2391fe !important;
padding-top: 8px;
}

code {
color: #2c3e50 !important;
color: #2c3e50 !important;
}

.alert-info {
background: lightgrey;
background: lightgrey;
}


.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus {
background: lightgrey;
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
background: lightgrey;
}

dt {
font-weight: normal;
font-weight: normal;
}

dd {
margin-left: 20px;
margin-left: 20px;
}

blockquote {
font-size: 15px;
border-left: none;
font-size: 15px;
border-left: none;
}

li {
margin-top: 8px;
margin-bottom: 8px;
margin-top: 8px;
margin-bottom: 8px;
}

code {
background-color: #F5F5F5
background-color: #f5f5f5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "jubilat", sans-serif;
}

@font-face {
font-family: "jubilat";
src: url("https://use.typekit.net/af/275f06/00000000000000003b9b0d24/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3")
format("woff2"),
url("https://use.typekit.net/af/275f06/00000000000000003b9b0d24/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3")
format("woff"),
url("https://use.typekit.net/af/275f06/00000000000000003b9b0d24/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3")
format("opentype");
font-display: auto;
font-style: normal;
font-weight: 400;
}

@font-face {
font-family: "jubilat";
src: url("https://use.typekit.net/af/d16a24/00000000000000003b9b0d22/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n5&v=3")
format("woff2"),
url("https://use.typekit.net/af/d16a24/00000000000000003b9b0d22/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n5&v=3")
format("woff"),
url("https://use.typekit.net/af/d16a24/00000000000000003b9b0d22/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n5&v=3")
format("opentype");
font-display: auto;
font-style: normal;
font-weight: 500;
}

a {
color: #506784 !important;
}

a:hover {
color: #0d67bf !important;
}
1 change: 1 addition & 0 deletions doc/apidoc/plotly.express.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ plotly's high-level API for rapid figure generation. ::
line_geo
area
bar
timeline
bar_polar
violin
box
Expand Down
1 change: 1 addition & 0 deletions doc/apidoc/plotly.figure_factory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
create_distplot
create_facet_grid
create_gantt
create_hexbin_mapbox
create_ohlc
create_quiver
create_scatterplotmatrix
Expand Down
63 changes: 0 additions & 63 deletions doc/python/3d-surface-coloring.md

This file was deleted.

36 changes: 33 additions & 3 deletions doc/python/3d-surface-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jupyter:
order: 3
page_type: example_index
permalink: python/3d-surface-plots/
redirect_from: python/3d-surface-coloring/
thumbnail: thumbnail/3d-surface.jpg
---

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

### Passing x and y data to 3D Surface Plot

If you do not specify `x` and `y` coordinates, integer indices are used for the `x` and `y` axis. You can also pass `x` and `y` values to `go.Surface`.
If you do not specify `x` and `y` coordinates, integer indices are used for the `x` and `y` axis. You can also pass `x` and `y` values to `go.Surface`.

```python
import plotly.graph_objects as go
Expand Down Expand Up @@ -98,7 +99,7 @@ fig.update_layout(title='Mt Bruno Elevation', autosize=False,
fig.show()
```
#### Configure Surface Contour Levels
This example shows how to slice the surface graph on the desired position for each of x, y and z axis. [contours.x.start](https://plotly.com/python/reference/#surface-contours-x-start) sets the starting contour level value, `end` sets the end of it, and `size` sets the step between each contour level.
This example shows how to slice the surface graph on the desired position for each of x, y and z axis. [contours.x.start](https://plotly.com/python/reference/#surface-contours-x-start) sets the starting contour level value, `end` sets the end of it, and `size` sets the step between each contour level.

```python
import plotly.graph_objects as go
Expand Down Expand Up @@ -163,7 +164,36 @@ fig = go.Figure(data=[
fig.show()
```

### Setting the Surface Color

You can use the `surfacecolor` attribute to define the color of the surface of your figure. In this example, the surface color represents the distance from the origin, rather than the default, which is the `z` value.

```python
import plotly.graph_objects as go
from plotly.subplots import make_subplots

# Equation of ring cyclide
# see https://en.wikipedia.org/wiki/Dupin_cyclide
import numpy as np
a, b, d = 1.32, 1., 0.8
c = a**2 - b**2
u, v = np.mgrid[0:2*np.pi:100j, 0:2*np.pi:100j]
x = (d * (c - a * np.cos(u) * np.cos(v)) + b**2 * np.cos(u)) / (a - c * np.cos(u) * np.cos(v))
y = b * np.sin(u) * (a - d*np.cos(v)) / (a - c * np.cos(u) * np.cos(v))
z = b * np.sin(v) * (c*np.cos(u) - d) / (a - c * np.cos(u) * np.cos(v))

fig = make_subplots(rows=1, cols=2,
specs=[[{'is_3d': True}, {'is_3d': True}]],
subplot_titles=['Color corresponds to z', 'Color corresponds to distance to origin'],
)

fig.add_trace(go.Surface(x=x, y=y, z=z, colorbar_x=-0.07), 1, 1)
fig.add_trace(go.Surface(x=x, y=y, z=z, surfacecolor=x**2 + y**2 + z**2), 1, 2)
fig.update_layout(title_text="Ring cyclide")
fig.show()
```

#### Reference


See https://plotly.com/python/reference/#surface for more information!
See https://plotly.com/python/reference/#surface for more information!
18 changes: 16 additions & 2 deletions doc/python/axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,20 @@ fig.update_yaxes(range=[3, 9])
fig.show()
```

#### Disabling Pan/Zoom on Axes (Fixed Range)

Pan/Zoom can be disabled for a given axis by setting `fixedrange` to `True`.

```python
import plotly.express as px
df = px.data.iris()

fig = px.scatter(df, x="sepal_width", y="sepal_length", facet_col="species")
fig.update_xaxes(fixedrange=True)

fig.show()
```

### Fixed Ratio Axes

The `scaleanchor` and `scaleratio` axis properties can be used to force a fixed ratio of pixels per unit between two axes.
Expand Down Expand Up @@ -742,7 +756,7 @@ fig.show()

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

Zoom in one trace below, to see the other subplots zoomed to the same x-axis range. To pan all the subplots, click and drag from the center of x-axis to the side:

Expand All @@ -763,4 +777,4 @@ fig.show()

#### Reference

See https://plotly.com/python/reference/#layout-xaxis and https://plotly.com/python/reference/#layout-yaxis for more information and chart attribute options!
See https://plotly.com/python/reference/#layout-xaxis and https://plotly.com/python/reference/#layout-yaxis for more information and chart attribute options!
Loading