{
  "id": "python/matplotlib-cmap-not-recognized",
  "signature": "ValueError: 'viridis_r' is not a valid value for cmap; supported values are: 'viridis', 'plasma', ...",
  "signature_zh": "ValueError: 'viridis_r' 不是 cmap 的有效值；支持的值包括：'viridis', 'plasma', ...",
  "regex": "ValueError:\\ 'viridis_r'\\ is\\ not\\ a\\ valid\\ value\\ for\\ cmap;\\ supported\\ values\\ are:\\ 'viridis',\\ 'plasma',\\ \\.\\.\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Passing a colormap name that matplotlib does not recognize, often due to a typo or a colormap registered by a different library (e.g., cmocean) that is not installed.",
  "root_cause_type": "generic",
  "root_cause_zh": "传入了 matplotlib 无法识别的 colormap 名称，通常是由于拼写错误或由其他库（如 cmocean）注册但未安装的 colormap。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Falls back to the default colormap, silently changing the intended visualization.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Also invalid; the correct suffix is '_r'.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "import matplotlib.pyplot as plt\nprint(list(plt.colormaps()))\nax.imshow(data, cmap='viridis_r')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "pip install cmocean\nimport cmocean\nax.imshow(data, cmap='cmo.thermal')",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-10-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}