小编mic*_*mic的帖子

更改散景网格线位置

我试图在图表上绘制几个点,类似于热图。

示例代码(改编自此处的热图部分):

import pandas as pd

from bokeh.io import output_notebook, show
from bokeh.models import BasicTicker, ColorBar, ColumnDataSource, LinearColorMapper, PrintfTickFormatter
from bokeh.plotting import figure
from bokeh.transform import transform
import numpy as np

# change this if you don't run it on a Jupyter Notebook
output_notebook()

testx = np.random.randint(0,10,10)
testy = np.random.randint(0,10,10)

npdata = np.stack((testx,testy), axis = 1)
hist, bins = np.histogramdd(npdata, normed = False, bins = (10,10), range=((0,10),(0,10)))

data = pd.DataFrame(hist, columns = [str(x) for x in range(10)])

data.columns.name = …
Run Code Online (Sandbox Code Playgroud)

python bokeh

1
推荐指数
1
解决办法
1753
查看次数

标签 统计

bokeh ×1

python ×1