{
  "id": "python/matplotlib-interactive-mode-error",
  "signature": "ValueError: Interactive mode must be a boolean, got 'True' (string).",
  "signature_zh": "ValueError: 交互模式必须是布尔值，但得到了'True'（字符串）。",
  "regex": "ValueError:\\ Interactive\\ mode\\ must\\ be\\ a\\ boolean,\\ got\\ 'True'\\ \\(string\\)\\.",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Passing a string instead of a boolean to plt.ion() or plt.ioff(), or setting rcParams['interactive'] to a string.",
  "root_cause_type": "generic",
  "root_cause_zh": "向plt.ion()或plt.ioff()传递了字符串而非布尔值，或将rcParams['interactive']设置为字符串。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using 1 or 0 instead of True/False",
      "why_fails": "While 1 and 0 are truthy, they are not booleans; the function expects a bool.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting plt.ion(True) with parentheses",
      "why_fails": "plt.ion() takes no arguments; it toggles interactive mode on. Passing an argument raises TypeError.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use plt.ion() to enable interactive mode (no arguments)",
      "success_rate": 0.95,
      "how": "plt.ion()",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set rcParams with a boolean",
      "success_rate": 0.9,
      "how": "plt.rcParams['interactive'] = True",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}