{
  "id": "python/matplotlib-cmap-name-error",
  "signature": "ValueError: 'viridis' is not a valid colormap name. Valid names are: ['Accent', 'Accent_r', 'Blues', ...]",
  "signature_zh": "ValueError: 'viridis'不是有效的颜色映射名称。有效名称包括：['Accent', 'Accent_r', 'Blues', ...]",
  "regex": "ValueError:\\ 'viridis'\\ is\\ not\\ a\\ valid\\ colormap\\ name\\.\\ Valid\\ names\\ are:\\ \\['Accent',\\ 'Accent_r',\\ 'Blues',\\ \\.\\.\\.\\]",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Using a typo in colormap name (e.g., 'viridis' instead of 'viridis'? Actually 'viridis' is correct; if user types 'viridiss' or 'virid' it fails). The error occurs when the string does not match any registered colormap.",
  "root_cause_type": "generic",
  "root_cause_zh": "颜色映射名称拼写错误（例如'viridis'拼写为'viridiss'）或使用了不存在的名称，导致无法找到匹配的颜色映射。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Assuming case insensitivity and trying 'Viridis'",
      "why_fails": "Colormap names are case-sensitive; 'Viridis' is not valid, only 'viridis' works.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using a numeric index like 0 for the first colormap",
      "why_fails": "Colormaps are accessed by name, not numeric index.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use the correct spelling from the list of valid colormaps",
      "success_rate": 0.95,
      "how": "plt.imshow(data, cmap='viridis')",
      "condition": "",
      "sources": []
    },
    {
      "action": "List all available colormaps to find the correct one",
      "success_rate": 0.9,
      "how": "from matplotlib import cm; print([m for m in cm._cmap_registry.keys()])",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}