plotly / plotly/plotly.py

Allow setting zmid with zmin and zmax in plotly.graph_objects.Heatmap

Open
#3,626 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Feature request

I've been trying to plot a subset of a ranked list (gene differential expression dataset). I would like the minimum and maximum color scale set to that of the original complete ranked list, with the midpoint set to zero. It currently seems to be impossible in plotly to do this. I can plot the subset with the colorscale min and max set to the original dataset min and max, but this causes the midpoint to no longer be set to zero.

It can be desirable to set a colorscale to the minimum and maximum of a positive/negative spanned dateset with unequal absolutes but to still have the midpoint at zero without needing to construct and entirely custom colorscale. zmid being ignored when zmax and zmin are set just seems a super odd behavior to me.

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 at plotly.graph_objects.Heatmap and trace how zmin, zmax, and zmid are handled for the colorscale. Check existing Heatmap tests for related behavior. Done means allowing zmid to remain effective when zmin and zmax are explicitly set, with coverage for unequal positive and negative bounds.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.