2

How can I achieve numerous, smooth, thin line plots that look like those in the first row of this post.

Energy time series data

The article mentions that the visualization are done using Pandas, matplotlib and Seaborn.

What I have tried

Suppose we have a separate power and heat data in a dataframe for different consumers, i.e. one dataframe for one consumer.

    t    demand    type
0   0    3.4       electricity
1   1    3.6       electricity
2   2    0.1       heat
3   3    0.4       heat

I now add the lineplot for every consumer

for energyDataDF in energyData:
    sns.lineplot(x='t', y="demand", size=0.1, ax=axes[0], hue="type", data=energyDataDF)
plt.show()

The look does not come close. Also the legend does not only show the two categories "electricity" and "heat" but also some numerical values, which, for me, indicates that something has gone wrong.

Also it takes quite some time to run, as I have around 1 million data points to plot. Surely I could put it all customers into one dataframe, but then the single lines do not show up. Instead I get error bars that cut off outliers, like this: Standard seaborn line plot

Question

How can I achieve the look of the above mentioned plot and how can I do so efficiently for large datasets.

ktnr
  • 245
  • 2
  • 9

0 Answers0