对于带有数据着色器的散点图,我想将时间的概念合并到图中。可能通过使用颜色。
目前,
import numpy as np
import pandas as pd
import seaborn as sns
date_values = ['2020-01-01', '2020-01-02', '2020-01-03', '2020-01-04']
result = []
for d in date_values:
print(d)
df = pd.DataFrame(np.random.randn(10000, 2), columns=list('AB'))
df.columns = ['value_foo', 'value_bar']
df['dt'] = d
df['dt'] = pd.to_datetime(df['dt'])
result.append(df)
df = pd.concat(result)
display(df.head())
import holoviews as hv
import holoviews.operation.datashader as hd
hv.extension("bokeh", "matplotlib")
import datashader as ds
import datashader.transfer_functions as tf
cvs = ds.Canvas().points(df, 'value_foo', 'value_bar')
from colorcet import fire
#tf.set_background(tf.shade(cvs, cmap=fire),"black")
tf.shade(cvs)
#sns.jointplot(x="value_foo", y="value_bar", data=df, hue='dt')
但是,现在无法区分不同的日期。绘图时如何包含日期信息(例如使用颜色)?