👌

holoviewsでcolorのグラデーションを出す

2022/04/01に公開

追記

cm.hsiなどが普通に使えたのでこっちのほうがいいかも

xs = np.linspace(0, np.pi*2)
hv.Curve(np.sin(xs+p)).opts(color=cm.hsv(5/30.0))

https://qiita.com/hokekiyoo/items/cea310b2c36a01b970a6

holoviewsで色んな色を使う

中には色が詰まってる

全部を確認

import numpy as np
import holoviews as hv
from holoviews import opts
hv.extension('bokeh')

xs = np.linspace(0, np.pi*2)
for key in hv.Cycle.default_cycles:
    print(key)
    color_lst = hv.Cycle.default_cycles[key]
    plot_objs = []
    for i, p in enumerate(np.linspace(0, np.pi, len(color_lst))):
        plot = hv.Curve(np.sin(xs+p)).opts(color=color_lst[i])
        plot_objs.append(plot)
    hv.ipython.display(hv.Overlay(plot_objs))

この辺が良さそう

Discussion