I added an area plot on my scatter plot using fill: "tozeroy"
.
To fill the area plot with “/” pattern, I use marker_pattern_shape: "/"
option but doesn’t work.
How to apply pattern shape on my plot?
This is my Area plot code:
const myArea = {
x: [0, 500, 1000, 1500, 2000, 2500],
y: [35, 35, 35, 35, 35, 35],
mode: "none",
type: "scatter",
fill: "tonexty", //"tozeroy",
fillcolor: "lightgray",
line: { color: "gray" },
lines_pattern_shape: "/",
name: "myArea",
opacity: 0.5,
}
Reference pages:
Over 8 examples of Patterns, Hatching, Texture including changing color, size, log axes, and more in Python.
Over 15 examples of Filled Area Plots including changing color, size, log axes, and more in JavaScript.
AIMPED
October 4, 2023, 7:22am
2
Welcome to the forums, @sophia_hye !
in Python you would do it like this, should be quite similar in JS.
import plotly.graph_objects as go
fig = go.Figure(
go.Scatter(
x=[0, 500, 1000, 1500, 2000, 2500],
y=[35, 35, 35, 35, 35, 35],
mode='lines',
fill= "tonexty",
fillcolor="lightgray",
fillpattern_shape='/',
line={'color': "gray"},
name="myArea",
opacity= 0.5
)
)