【发布时间】:2021-05-15 14:07:55
【问题描述】:
我正在尝试在我的几个线图中添加一个背景,该背景显示每年从值 x(列“Min”)到值 y(列“Max”)的范围。我的数据集如下所示:
Country Model Year Costs Min Max
494 FR 1 1990 300 250 350
495 FR 1 1995 250 300 400
496 FR 1 2000 220 330 640
497 FR 1 2005 210 289 570
498 FR 2 1990 400 250 350
555 JPN 8 1990 280 250 350
556 JPN 8 1995 240 300 400
557 JPN 8 2000 200 330 640
558 JPN 8 2005 200 289 570
我使用了以下代码:
example_1 = sns.relplot(data=example, x = "Year", y = "Costs", hue = "Model", style = "Model", col = "Country", kind="line", col_wrap=4,height = 4, dashes = True, markers = True, palette = palette, style_order = style_order)
我想要这样的东西,范围是我每年的“最小”和“最大”。
有可能吗? 非常感谢!
【问题讨论】:
-
我的回答是否提供了您正在寻找的解决方案?
-
你好帕特里克!您的回答正是我正在寻找的解决方案!非常感谢您的详细解释!
标签: python pandas matplotlib seaborn