plotly / plotly/plotly.py

The border disappears after adding zorder.

Open
#5,248 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

import plotly.graph_objects as go
import plotly.io as pio
import numpy as np
pio.renderers.default = 'browser'
fig = go.Figure()
lk_x=[0,0,1,1,0]
lk_y=[0,1,1,0,0]
data_line = go.Scatter(x=lk_x, y=lk_y, mode='lines', fill='toself', fillcolor='rgba(60, 53, 48, 0.5)', line_color='black', showlegend=False)
fig.add_trace(go.Scatter(
x=[0, 1, 2],
y=[1, 3, 2],
mode='lines+markers',
name='Test',
# zorder=2,
))
fig.add_trace(data_line)
fig.update_layout(
xaxis=dict(
showline=True,
mirror=True,
linecolor='black',
linewidth=2,
ticks='outside',
showgrid=False,
),
yaxis=dict(
showline=True,
mirror=True,
linecolor='black',
linewidth=2,
ticks='outside',
showgrid=False,
scaleanchor='x',
scaleratio=1,
),
plot_bgcolor='white',
paper_bgcolor='white',
height=500,
width=500,
margin=dict(l=40, r=40, t=40, b=40),
xaxis_title='X ',
yaxis_title='Y ',
font=dict(size=12, color="black")
)
fig.show()

Image

when add zorder=2,the border is disappear as figure show:

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Python reproduction in a browser renderer with the second trace's zorder commented and uncommented. Compare the axis border in both figures; done means the border remains visible when zorder is set, without changing the demonstrated plot behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.