Skip to content

filled area #2089

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 3 commits into from
Jan 21, 2020
Merged

filled area #2089

merged 3 commits into from
Jan 21, 2020

Conversation

Mahdis-z
Copy link
Contributor

@Mahdis-z Mahdis-z commented Jan 17, 2020

closes #2080

@Mahdis-z Mahdis-z requested a review from emmanuelle January 17, 2020 00:45
@@ -682,5 +682,25 @@ fig.update_layout(
fig.show()
```

### Filled Area Chart
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this to the very top, with a little intro saying "there are two ways to draw filled shapes: scatter traces and layout.shapes" with a note that layout.shapes is mostly useful for cartesian 2d subplots, but you can use e.g. scatterpolar and scattergeo and scattermapbox to draw filled shapes on any kind of subplots.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can add a link to the scatterpolar page where we have filled shapes, and to the "filled shapes on mapbox" page that you wrote last year?

```python
import plotly.graph_objects as go

fig = go.Figure(go.Scatter(x=[0,1,2], y=[0,2,0], fill="toself"))
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a final point that's the same as the initial point, so the line goes all the way around?

```python
import plotly.graph_objects as go

fig = go.Figure(go.Scatter(x=[0,1,2,None,3,3,5,5], y=[0,2,0,None,0.5,1.5,1.5,0.5], fill="toself"))
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a final point to each shape that's the same as the initial point, so the line goes all the way around?

@@ -33,6 +33,26 @@ jupyter:
thumbnail: thumbnail/shape.jpg
---

### Filled Area Chart

There are two ways to draw filled shapes: scatter traces and [layout.shapes](https://plot.ly/python/reference/#layout-shapes-items-shape-type) which is mostly useful for the 2d subplots, and defines the shape type to be drawn, and can be rectangle, circle, line, or path (a custom SVG path). You also can use [scatterpolar](https://plot.ly/python/polar-chart/#categorical-polar-chart), scattergeo, [scattermapbox](https://plot.ly/python/filled-area-on-mapbox/#filled-scattermapbox-trace) to draw filled shapes on any kind of subplots. To set an area to be filled with a solid color, you need to define [Scatter.fill="toself"](https://plot.ly/python/reference/#scatter-fill) that connects the endpoints of the trace into a closed shape.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a sentence saying that if mode contains "lines" (which is the default) then you'll likely want to repeat the first point of a shape at the end of the sequence, so the line goes all the way around.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah to have a closed shape, all right!

@nicolaskruchten nicolaskruchten changed the base branch from master to doc-prod January 20, 2020 20:25
@nicolaskruchten nicolaskruchten changed the base branch from doc-prod to master January 20, 2020 20:25
@nicolaskruchten
Copy link
Contributor

💃 when the build is green

@Mahdis-z Mahdis-z merged commit 8e5bbad into master Jan 21, 2020
@Mahdis-z Mahdis-z deleted the filled_area_py branch January 21, 2020 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Filled Polygon
2 participants