Skip to content

Feature Request: Filled Polygon #2080

@peterdsharpe

Description

@peterdsharpe

Hey all,

First off - thanks for all your hard work on this beautiful visualization library. I have a feature request that would be very handy in my scientific computing work, and I wanted to submit it to you for your consideration:

Matplotlib has a very useful command to draw a 2D filled polygon (matplotlib.pyplot.fill), exhibited here:
https://matplotlib.org/3.1.1/gallery/lines_bars_and_markers/fill.html

It would be very helpful to have an equivalent command available through Plotly. As far as I'm aware, this feature does not yet exist. The closest equivalent that I could find is an SVG Path, exhibited here:
https://plot.ly/python/shapes/#svg-paths

However, the input syntax is pretty clunky, especially if one wants to plot a filled polygon with many vertices defined from, say, a NumPy ndarray:

        go.layout.Shape(
            type="path",
            path=" M 3,7 L2,8 L2,9 L3,10, L4,10 L5,9 L5,8 L4,7 Z",
            fillcolor="PaleTurquoise",
            line_color="LightSeaGreen",
        ),

A more streamlined interface, with syntax that lends itself to scientific computing (like matplotlib.pyplot.fill), would be greatly appreciated. Is this a feature the Plotly team would consider adding?

Thank you so much!
-Peter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions