I'm trying to plot a team's score in a competition over time, compared to the max and the min of teams' scores at that time. I have a working example with min & max as lines.
However, I would prefer showing the min and the max via a shaded area, a bit like this picture but without the average of the min and max being plotted (the blue line).
Can someone more competent in Seaborn or matplotlib help me out?
I've unsuccessfully tried:
- stopping the min & max's average line from being calculated at all
- hiding the min & max's average line (e.g. reducing its size to 0)
- tweaking Seaborn's confidence interval "ci" as per this answer
I have a preference for using Seaborn because of its nice "look & feel" but at this point, I'll take whatever works.
Dataset shown on the graph
timestamp group score
4 1.563890e+09 13 0.000
0 1.563890e+09 min 0.000
0 1.563890e+09 max 100.000
4 1.563890e+09 13 0.000
0 1.563890e+09 min 0.000
0 1.563890e+09 max 99.675
4 1.563890e+09 13 0.000
0 1.563890e+09 min 0.000
0 1.563890e+09 max 99.675
0 1.563890e+09 13 39.101
0 1.563890e+09 min 0.000
0 1.563890e+09 max 74.573
0 1.563890e+09 13 39.101
0 1.563890e+09 min 37.853
0 1.563890e+09 max 74.573`
code of first screenshot (scoreboard is a larger pandas dataframe)
s = scoreboard[(scoreboard.group == 13) | (scoreboard.group == "max") | (scoreboard.group == "min")]
sns.lineplot(x="timestamp", y="score", hue="group", data=s, marker="o")
code of second screenshot (scoreboard is a larger pandas dataframe)
s = scoreboard[(scoreboard.group == 13)]
s0 = scoreboard[(scoreboard.group == "max") | (scoreboard.group == "min")]
sns.lineplot(x="timestamp", y="score", data=s0, marker="o")
sns.lineplot(x="timestamp", y="score", data=s, marker="o")