Skip to content

[BUG] Colorbar region labels are incorrectly positioned when label_regions=True #85

@zenWai

Description

@zenWai

Intro: When label_regions=True, brain regions are labeled on the colorbar.

Describe the bug
Currently the labeling position on the colorbar depends on the values dictionary order.
Float values of the brain regions don't map correctly to colormap values/position.
The number of colors on the colorbar are dictated by the number of regions in the values dictionary.

To Reproduce
Run heatmap_2d.py with label_regions=True

  • For example, region "TH" with a value of 1 gets incorrectly labeled at the position corresponding to the minimum value (-5) of the colorbar instead of at its actual value position.
  • On the values dictionary 'AI'=0.4 and 'SS'=-3, on the example colormap 'AI' is shown as lower than 'SS'
Using annotate_regions=True to visually help identify the bug
Image

Expected behaviour

  • map region colors to colormap values/color
  • Maybe label only the regions that are visible in the subplot?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions