Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Refactor `add_vline()`, `add_hline()`, `add_hrect()`, `add_vrect()` to use Plotly.js `shape.label` attribute

Open
#5,373 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, python

Research direction

Start with the implementations of fig.add_vline(), fig.add_hline(), fig.add_hrect(), and fig.add_vrect(), then compare their annotation handling with Plotly.js's shape.label support. Verify the four helpers use shape labels instead of separate annotation objects while preserving their label arguments and placement behavior.

Written by the indexing model from the issue text.

Description

feature P2

The Plotly.py functions fig.add_vline(), fig.add_hline(), fig.add_hrect(), fig.add_vrect() accept arguments such as annotation_text which are used to create a label for the shape. This is done by creating and adding two separate objects to the Plotly.js layout: a shape, and an annotation.

However, now that Plotly.js has added support for shape labels, this is no longer necessary -- the text can be added directly as a label to the shape rather than creating two separate objects.

This would solve issues such as https://github.com/plotly/plotly.py/issues/3065 where we are doing some hacky stuff to get the label in the right place.

Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
13h 41m
Merged PRs (30d)
21

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.

More from plotly/plotly.py

All issues in plotly/plotly.py

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.