{
  "id": "python/matplotlib-3d-proj-not-registered",
  "signature": "ValueError: Unknown projection '3d'",
  "signature_zh": "ValueError: 未知投影 '3d'",
  "regex": "ValueError:\\ Unknown\\ projection\\ '3d'",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "Using add_subplot(projection='3d') without importing mpl_toolkits.mplot3d, so the projection is not registered.",
  "root_cause_type": "generic",
  "root_cause_zh": "在未导入 mpl_toolkits.mplot3d 的情况下使用 add_subplot(projection='3d')，导致投影未注册。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "mpl_toolkits ships with matplotlib; installing it separately is unnecessary and may cause version conflicts.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Matplotlib projection names are case-sensitive; '3D' is not registered either.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.96,
      "how": "import matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D  # noqa: F401\nfig = plt.figure()\nax = fig.add_subplot(111, projection='3d')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.93,
      "how": "import matplotlib.pyplot as plt\nax = plt.axes(projection='3d')\nax.plot3D([0,1,2], [0,1,2], [0,1,2])",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}