{
  "id": "python/matplotlib-axes-limits-error",
  "signature": "ValueError: xlim must be a 2-element sequence of numbers, got [0, 10, 20]",
  "signature_zh": "ValueError: xlim必须是包含两个数字的序列，但得到了[0, 10, 20]",
  "regex": "ValueError:\\ xlim\\ must\\ be\\ a\\ 2\\-element\\ sequence\\ of\\ numbers,\\ got\\ \\[0,\\ 10,\\ 20\\]",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Passing a list with more than two elements to set_xlim() or xlim parameter.",
  "root_cause_type": "generic",
  "root_cause_zh": "向set_xlim()或xlim参数传递了包含两个以上元素的列表。",
  "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": "Passing a tuple of three numbers",
      "why_fails": "A tuple with three elements also fails; only two-element sequences are allowed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using xlim=(0,10,20) as keyword argument",
      "why_fails": "Same issue; xlim expects exactly two values.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a two-element sequence",
      "success_rate": 0.95,
      "how": "ax.set_xlim([0, 10])  # or (0, 10)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set min and max separately",
      "success_rate": 0.9,
      "how": "ax.set_xlim(left=0, right=10)",
      "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-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}