Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Masked arrays not working with categorical data #19722

Copy link
Copy link
Open
@juliospain

Description

@juliospain
Issue body actions

Bug report

Bug summary

Masked arrays are nicely supported by MPL. The masked data is not plotted and even the line interrupted.
However, when the data is str (categorical) the mask is completely ignored.

Code for reproduction

import numpy.ma
x = range(3)
y = numpy.ma.array(['hello', 'bye', 'bye2'], mask=[False, True, False])
plt.plot(x,y)
plt.show()

Actual outcome

image

Expected outcome

Probably the "bye" label should not even be put in the y-axis.
There should be no line but two "dots" in hello and bye2.

Matplotlib version

  • Operating system: Windows
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.3.4
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.8

Installed from conda-forge

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepItems to be ignored by the “Stale” Github ActionItems to be ignored by the “Stale” Github Actiontopic: categorical

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.