Title: [Bug]: missing stubs for `plt.cm` (a.k.a. `matplotlib.pyplot.cm`) · Issue #30438 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: missing stubs for `plt.cm` (a.k.a. `matplotlib.pyplot.cm`) · Issue #30438 · matplotlib/matplotlib
X Title: [Bug]: missing stubs for `plt.cm` (a.k.a. `matplotlib.pyplot.cm`) · Issue #30438 · matplotlib/matplotlib
Description: Bug summary If I run help(plt.cm) I get a very nice runtime type info: help(plt.cm) help(plt.cm) Help on module matplotlib.cm in matplotlib: NAME matplotlib.cm - Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mi...
Open Graph Description: Bug summary If I run help(plt.cm) I get a very nice runtime type info: help(plt.cm) help(plt.cm) Help on module matplotlib.cm in matplotlib: NAME matplotlib.cm - Builtin colormaps, colormap handlin...
X Description: Bug summary If I run help(plt.cm) I get a very nice runtime type info: help(plt.cm) help(plt.cm) Help on module matplotlib.cm in matplotlib: NAME matplotlib.cm - Builtin colormaps, colormap handlin...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/30438
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: missing stubs for `plt.cm` (a.k.a. `matplotlib.pyplot.cm`)","articleBody":"### Bug summary\n\nIf I run `help(plt.cm)` I get a very nice runtime type info:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cpre\u003ehelp(plt.cm)\u003c/pre\u003e\u003c/summary\u003e\n\u003cpre\u003e\nhelp(plt.cm)\nHelp on module matplotlib.cm in matplotlib:\nNAME\n matplotlib.cm - Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.\nDESCRIPTION\n .. seealso::\n :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.\n :ref:`colormap-manipulation` for examples of how to make\n colormaps.\n :ref:`colormaps` an in-depth discussion of choosing\n colormaps.\n :ref:`colormapnorms` for more details about data normalization.\nCLASSES\n collections.abc.Mapping(collections.abc.Collection)\n ColormapRegistry\n class ColormapRegistry(collections.abc.Mapping)\n | ColormapRegistry(cmaps)\n |\n | Container for colormaps that are known to Matplotlib by name.\n |\n | The universal registry instance is `matplotlib.colormaps`. There should be\n | no need for users to instantiate `.ColormapRegistry` themselves.\n |\n | Read access uses a dict-like interface mapping names to `.Colormap`\\s::\n |\n | import matplotlib as mpl\n | cmap = mpl.colormaps['viridis']\n |\n | Returned `.Colormap`\\s are copies, so that their modification does not\n | change the global definition of the colormap.\n |\n | Additional colormaps can be added via `.ColormapRegistry.register`::\n |\n | mpl.colormaps.register(my_colormap)\n |\n | To get a list of all registered colormaps, you can do::\n |\n | from matplotlib import colormaps\n | list(colormaps)\n |\n | Method resolution order:\n | ColormapRegistry\n | collections.abc.Mapping\n | collections.abc.Collection\n | collections.abc.Sized\n | collections.abc.Iterable\n | collections.abc.Container\n | builtins.object\n |\n | Methods defined here:\n |\n | __call__(self)\n | Return a list of the registered colormap names.\n |\n | This exists only for backward-compatibility in `.pyplot` which had a\n | ``plt.colormaps()`` method. The recommended way to get this list is\n | now ``list(colormaps)``.\n |\n | __getitem__(self, item)\n |\n | __init__(self, cmaps)\n | Initialize self. See help(type(self)) for accurate signature.\n |\n | __iter__(self)\n |\n | __len__(self)\n |\n | __str__(self)\n | Return str(self).\n |\n | get_cmap(self, cmap)\n | Return a color map specified through *cmap*.\n |\n | Parameters\n | ----------\n | cmap : str or `~matplotlib.colors.Colormap` or None\n |\n | - if a `.Colormap`, return it\n | - if a string, look it up in ``mpl.colormaps``\n | - if None, return the Colormap defined in :rc:`image.cmap`\n |\n | Returns\n | -------\n | Colormap\n |\n | register(self, cmap, *, name=None, force=False)\n | Register a new colormap.\n |\n | The colormap name can then be used as a string argument to any ``cmap``\n | parameter in Matplotlib. It is also available in ``pyplot.get_cmap``.\n |\n | The colormap registry stores a copy of the given colormap, so that\n | future changes to the original colormap instance do not affect the\n | registered colormap. Think of this as the registry taking a snapshot\n | of the colormap at registration.\n |\n | Parameters\n | ----------\n | cmap : matplotlib.colors.Colormap\n | The colormap to register.\n |\n | name : str, optional\n | The name for the colormap. If not given, ``cmap.name`` is used.\n |\n | force : bool, default: False\n | If False, a ValueError is raised if trying to overwrite an already\n | registered name. True supports overwriting registered colormaps\n | other than the builtin colormaps.\n |\n | unregister(self, name)\n | Remove a colormap from the registry.\n |\n | You cannot remove built-in colormaps.\n |\n | If the named colormap is not registered, returns with no error, raises\n | if you try to de-register a default colormap.\n |\n | .. warning::\n |\n | Colormap names are currently a shared namespace that may be used\n | by multiple packages. Use `unregister` only if you know you\n | have registered that name before. In particular, do not\n | unregister just in case to clean the name before registering a\n | new colormap.\n |\n | Parameters\n | ----------\n | name : str\n | The name of the colormap to be removed.\n |\n | Raises\n | ------\n | ValueError\n | If you try to remove a default built-in colormap.\n |\n | ----------------------------------------------------------------------\n | Data descriptors defined here:\n |\n | __dict__\n | dictionary for instance variables\n |\n | __weakref__\n | list of weak references to the object\n |\n | ----------------------------------------------------------------------\n | Data and other attributes defined here:\n |\n | __abstractmethods__ = frozenset()\n |\n | ----------------------------------------------------------------------\n | Methods inherited from collections.abc.Mapping:\n |\n | __contains__(self, key)\n |\n | __eq__(self, other)\n | Return self==value.\n |\n | get(self, key, default=None)\n | D.get(k[,d]) -\u003e D[k] if k in D, else d. d defaults to None.\n |\n | items(self)\n | D.items() -\u003e a set-like object providing a view on D's items\n |\n | keys(self)\n | D.keys() -\u003e a set-like object providing a view on D's keys\n |\n | values(self)\n | D.values() -\u003e an object providing a view on D's values\n |\n | ----------------------------------------------------------------------\n | Data and other attributes inherited from collections.abc.Mapping:\n |\n | __hash__ = None\n |\n | __reversed__ = None\n |\n | ----------------------------------------------------------------------\n | Class methods inherited from collections.abc.Collection:\n |\n | __subclasshook__(C)\n | Abstract classes can override this to customize issubclass().\n |\n | This is invoked early on by abc.ABCMeta.__subclasscheck__().\n | It should return True, False or NotImplemented. If it returns\n | NotImplemented, the normal algorithm is used. Otherwise, it\n | overrides the normal algorithm (and the outcome is cached).\n |\n | ----------------------------------------------------------------------\n | Class methods inherited from collections.abc.Iterable:\n |\n | __class_getitem__ = GenericAlias(args, /)\n | Represent a PEP 585 generic type\n |\n | E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).\nFUNCTIONS\n get_cmap(name=None, lut=None)\n [*Deprecated*] Get a colormap instance, defaulting to rc values if *name* is None.\n Parameters\n ----------\n name : `~matplotlib.colors.Colormap` or str or None, default: None\n If a `.Colormap` instance, it will be returned. Otherwise, the name of\n a colormap known to Matplotlib, which will be resampled by *lut*. The\n default, None, means :rc:`image.cmap`.\n lut : int or None, default: None\n If *name* is not already a Colormap instance and *lut* is not None, the\n colormap will be resampled to have *lut* entries in the lookup table.\n Returns\n -------\n Colormap\n Notes\n -----\n .. deprecated:: 3.7\n Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap()`` or ``pyplot.get_cmap()`` instead.\nDATA\n Accent = \u003cmatplotlib.colors.ListedColormap object\u003e\n Accent_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n Blues = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Blues_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n BrBG = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n BrBG_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n BuGn = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n BuGn_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n BuPu = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n BuPu_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n CMRmap = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n CMRmap_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Dark2 = \u003cmatplotlib.colors.ListedColormap object\u003e\n Dark2_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n GnBu = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n GnBu_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Grays = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Grays_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Greens = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Greens_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Greys = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Greys_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n OrRd = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n OrRd_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Oranges = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Oranges_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PRGn = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PRGn_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Paired = \u003cmatplotlib.colors.ListedColormap object\u003e\n Paired_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n Pastel1 = \u003cmatplotlib.colors.ListedColormap object\u003e\n Pastel1_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n Pastel2 = \u003cmatplotlib.colors.ListedColormap object\u003e\n Pastel2_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n PiYG = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PiYG_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuBu = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuBuGn = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuBuGn_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuBu_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuOr = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuOr_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuRd = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n PuRd_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Purples = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Purples_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdBu = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdBu_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdGy = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdGy_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdPu = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdPu_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdYlBu = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdYlBu_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdYlGn = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n RdYlGn_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Reds = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Reds_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Set1 = \u003cmatplotlib.colors.ListedColormap object\u003e\n Set1_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n Set2 = \u003cmatplotlib.colors.ListedColormap object\u003e\n Set2_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n Set3 = \u003cmatplotlib.colors.ListedColormap object\u003e\n Set3_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n Spectral = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Spectral_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Wistia = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n Wistia_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlGn = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlGnBu = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlGnBu_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlGn_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlOrBr = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlOrBr_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlOrRd = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n YlOrRd_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n afmhot = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n afmhot_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n autumn = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n autumn_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n berlin = \u003cmatplotlib.colors.ListedColormap object\u003e\n berlin_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n binary = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n binary_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n bivar_cmaps = {'BiCone': \u003cmatplotlib.colors.SegmentedBivarColormap obj...\n bone = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n bone_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n brg = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n brg_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n bwr = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n bwr_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n cividis = \u003cmatplotlib.colors.ListedColormap object\u003e\n cividis_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n cmaps_listed = {'berlin': \u003cmatplotlib.colors.ListedColormap object\u003e, '...\n cool = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n cool_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n coolwarm = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n coolwarm_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n copper = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n copper_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n cubehelix = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n cubehelix_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n datad = {'Accent': {'listed': ((0.4980392156862745, 0.788235294117647,...\n flag = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n flag_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_earth = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_earth_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_gray = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_gray_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_grey = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_grey_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_heat = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_heat_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_ncar = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_ncar_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_rainbow = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_rainbow_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_stern = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_stern_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_yarg = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_yarg_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_yerg = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gist_yerg_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gnuplot = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gnuplot2 = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gnuplot2_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gnuplot_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gray = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n gray_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n grey = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n grey_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n hot = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n hot_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n hsv = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n hsv_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n inferno = \u003cmatplotlib.colors.ListedColormap object\u003e\n inferno_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n jet = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n jet_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n magma = \u003cmatplotlib.colors.ListedColormap object\u003e\n magma_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n managua = \u003cmatplotlib.colors.ListedColormap object\u003e\n managua_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n multivar_cmaps = {'2VarAddA': \u003cmatplotlib.colors.MultivarColormap obje...\n nipy_spectral = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n nipy_spectral_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n ocean = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n ocean_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n pink = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n pink_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n plasma = \u003cmatplotlib.colors.ListedColormap object\u003e\n plasma_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n prism = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n prism_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n rainbow = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n rainbow_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n seismic = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n seismic_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n spring = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n spring_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n summer = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n summer_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n tab10 = \u003cmatplotlib.colors.ListedColormap object\u003e\n tab10_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n tab20 = \u003cmatplotlib.colors.ListedColormap object\u003e\n tab20_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n tab20b = \u003cmatplotlib.colors.ListedColormap object\u003e\n tab20b_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n tab20c = \u003cmatplotlib.colors.ListedColormap object\u003e\n tab20c_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n terrain = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n terrain_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n turbo = \u003cmatplotlib.colors.ListedColormap object\u003e\n turbo_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n twilight = \u003cmatplotlib.colors.ListedColormap object\u003e\n twilight_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n twilight_shifted = \u003cmatplotlib.colors.ListedColormap object\u003e\n twilight_shifted_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n vanimo = \u003cmatplotlib.colors.ListedColormap object\u003e\n vanimo_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n viridis = \u003cmatplotlib.colors.ListedColormap object\u003e\n viridis_r = \u003cmatplotlib.colors.ListedColormap object\u003e\n winter = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\n winter_r = \u003cmatplotlib.colors.LinearSegmentedColormap object\u003e\nFILE\n e:\\0sandbox\\archive.org-downloader\\.venv\\lib\\site-packages\\matplotlib\\cm.py\n\u003c/code\u003e\n\u003c/details\u003e\n\nBut the stub is quite sad:\nhttps://github.com/matplotlib/matplotlib/blob/1c3e0438cb890fe12e91c73b3782cae3b87060a5/lib/matplotlib/cm.pyi#L1-L22\n\nThis discrepancy leads to type-checker catching sadness\n\n\u003cimg width=\"332\" height=\"66\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/476e1c13-50d7-4caf-9810-1d57e977054f\" /\u003e\n\nsnipet:\n```console\nr\u003e mypy -c \"import matplotlib.pyplot as plt; plt.cm.gray\"\n\u003cstring\u003e:1: error: Module has no attribute \"gray\" [attr-defined]\nFound 1 error in 1 file (checked 1 source file)\n```\n\n\u003chr/\u003e\n\nI'm happy to help resolve this, but I'd like a few words of guidance as to what strategy should be used. Hardcoding? A cm.pyi codegen? Some sort of ignoring directive? Maybe even delete the current cm.pyi?\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\nplt.cm.gray\n```\n\n### Actual outcome\n\n\u003cstring\u003e:1: error: Module has no attribute \"gray\" [attr-defined]\nFound 1 error in 1 file (checked 1 source file)\n\n### Expected outcome\n\n` `\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.10.5\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/refack","@type":"Person","name":"refack"},"datePublished":"2025-08-16T23:10:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/30438/matplotlib/issues/30438"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:29b51552-375f-2118-e3e1-7c65b6513b9f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D436:3614ED:2243C64:2D5E136:6A51FACF |
| html-safe-nonce | 31c5a2932148e6883378f08309ee3e0f395cd307fc93170a495817dbb5123560 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDM2OjM2MTRFRDoyMjQzQzY0OjJENUUxMzY6NkE1MUZBQ0YiLCJ2aXNpdG9yX2lkIjoiNjE0Njg3MTUwMjYzMTQ2NzcyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ed1eacf33333ca482b059eeee3166ae19af8ec8dae3c04444e74056a58d652c7 |
| hovercard-subject-tag | issue:3327732326 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/30438/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5b5a4076d95fa8d6ae72158bba6f71c428bad4f4cc39fd836c94195c11158f81/matplotlib/matplotlib/issues/30438 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5b5a4076d95fa8d6ae72158bba6f71c428bad4f4cc39fd836c94195c11158f81/matplotlib/matplotlib/issues/30438 |
| og:image:alt | Bug summary If I run help(plt.cm) I get a very nice runtime type info: help(plt.cm) help(plt.cm) Help on module matplotlib.cm in matplotlib: NAME matplotlib.cm - Builtin colormaps, colormap handlin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | refack |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width