本文整理汇总了Python中bokeh.io.show方法的典型用法代码示例。如果您正苦于以下问题:Python io.show方法的具体用法?Python io.show怎么用?Python io.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bokeh.io
的用法示例。
在下文中一共展示了io.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def show(self):
"""Display a figure (called by backtrader)."""
# as the plot() function only created the figures and the columndatasources with no data -> now we fill it
for idx in range(len(self.figurepages)):
model = self.generate_model(idx)
if self.p.output_mode in ['show', 'save']:
if self._iplot:
css = self._output_stylesheet()
display(HTML(css))
show(model)
else:
filename = self._output_plot_file(model, idx, self.p.filename)
if self.p.output_mode == 'show':
view(filename)
elif self.p.output_mode == 'memory':
pass
else:
raise RuntimeError(f'Invalid parameter "output_mode" with value: {self.p.output_mode}')
self._reset()
示例2: pie_b
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def pie_b(df):
# df.loc[df['pop'] < 2.e6, 'country'] = 'Other countries' # Represent only large countries
fig = px.pie(df, values='parkClassFre', names='parkClass', title=' ',color_discrete_sequence=px.colors.sequential.RdBu)
# Spectral11 = ("#5e4fa2", "#3288bd", "#66c2a5", "#abdda4", "#e6f598", "#ffffbf", "#fee08b", "#fdae61", "#f46d43", "#d53e4f", "#9e0142","#fc8d59")
# fig.update_traces(textfont_size=15,textinfo='label+percent',) #textposition='inside', textinfo='percent+label'
fig.update_layout(
# width=200,height=200,
# title="Plot Title",
# xaxis_title="x Axis Title",
# yaxis_title="y Axis Title",
font=dict(
family='SimHei', #'Times New Roman'
size=15,
# color="#7f7f7f"
),
)
fig.show()
#计算百分比_地表覆盖
#'classi_count','cla_treeCanopy', 'cla_grassShrub','cla_bareSoil', 'cla_buildings', 'cla_roadsRailraods', 'cla_otherPavedSurfaces','cla_water',
示例3: plot
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def plot(self, **kwargs) -> Tuple[figure, LayoutDOM]:
"""
Build and plot a process tree.
Parameters
----------
schema : ProcSchema, optional
The data schema to use for the data set, by default None
(if None the schema is inferred)
output_var : str, optional
Output variable for selected items in the tree,
by default None
legend_col : str, optional
The column used to color the tree items, by default None
show_table: bool
Set to True to show a data table, by default False.
Other Parameters
----------------
height : int, optional
The height of the plot figure
(the default is 700)
width : int, optional
The width of the plot figure (the default is 900)
title : str, optional
Title to display (the default is None)
Returns
-------
Tuple[figure, LayoutDOM]:
figure - The main bokeh.plotting.figure
Layout - Bokeh layout structure.
"""
return build_and_show_process_tree(data=self._df, **kwargs)
示例4: show
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def show(self):
if len(self.figures) > 0:
plot = column(*self.figures)
show(plot)
示例5: prepare_f_help_source
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def prepare_f_help_source(f):
data = dict(phase=[(np.max(f.time) - np.min(f.time)) * 0.98 + np.min(f.time)],
flux=[(np.max(f.flux) - np.min(f.flux)) * 0.98 + np.min(f.flux)],
helpme=['?'],
help=["""
<div style="width: 375px;">
<div style="height: 190px;">
</div>
<div>
<span style="font-size: 12px; font-weight: bold;">Folded Light Curve</span>
</div>
<div>
<span style="font-size: 11px;"">This panel shows the folded light curve,
using the period currently selected in the BLS panel [left], indicated by the red line.
The transit model is show in red, and duration of the transit model
is given by the duration slider below. Update the slider to change the duration.
The period and transit midpoint values of the model are given above this panel.</span>
<br></br>
<span style="font-size: 11px;"">If the folded transit looks like a near miss of
the true period, try zooming in on the peak in the BLS Periodogram panel [right]
with the Box Zoom tool. This will increase the resolution of the peak, and provide
a better period solution. You can also vary the transit duration, for a better fit.
If the transit model is too shallow, it may be that you have selected a harmonic.
Look in the BLS Periodogram for a peak at (e.g. 0.25x, 0.5x, 2x, 4x the current period etc).</span>
</div>
</div>
"""])
return ColumnDataSource(data=data)
示例6: show
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def show(self):
return pn.layout.Column(self.widgets, self.pnplot)
示例7: _update_plot
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def _update_plot(self, b):
clear_output()
self.get_plot()
self.show()
示例8: show
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def show(self, use_datashade=False):
varrdict = OrderedDict()
for dim in self.varr_hv.vdims:
cur_d = self.varr_hv.reindex(vdims=[dim.name])
fim = fct.partial(self._img, dat=cur_d)
im = hv.DynamicMap(fim, streams=[self.stream])
im = regrid(im, height=self._h, width=self._w)
im = im(plot={'width': self._w, 'height': self._h})
image = im.relabel(group=dim.name, label='Image')
varrdict[dim.name] = image
ma = hv.DynamicMap(self._rgb, streams=[self.stream])
ma = regrid(ma, height=self._h, width=self._w * 2)
ma = ma.relabel(label="Match Image")
ma = ma(plot={'height': self._h, 'width': self._w * 2})
return hv.Layout(ma + hv.NdLayout(varrdict, kdims=['name'])).cols(1)
示例9: std_distance
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def std_distance(self):
self.background('square', fill_alpha=0, line_alpha=1, color='lightgrey')
self.set_size(N.ACTIVE_DISTANCE, min=0.1)
self.foreground('square', fill_alpha=1, line_alpha=0, color='black')
self.show()
示例10: std_distance_climb_direction
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def std_distance_climb_direction(self):
self.background('circle', fill_alpha=1, line_alpha=0, color='#F0F0F0')
self.set_size(N.ACTIVE_DISTANCE, min=0.2, max=1.1)
self.set_palette(N.TOTAL_CLIMB, K2R, gamma=0.3) # more red
self.foreground('circle', fill_alpha=1, line_alpha=0)
self.foreground('circle', fill_alpha=0, line_alpha=1, color='grey')
self.set_arc(N.DIRECTION, N.ASPECT_RATIO, delta_radius=0.2)
self.foreground('arc', fill_alpha=0, line_alpha=1, color='black')
self.show()
示例11: std_distance_fitness_direction
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def std_distance_fitness_direction(self):
fitness = sorted(like(N._delta(N.FITNESS_ANY), self._df.columns))[0]
self.background('circle', fill_alpha=0, line_alpha=1, color='lightgrey')
self.set_size(N.ACTIVE_DISTANCE, min=0.2, max=1.1)
self.set_palette(fitness, B2R, gamma=0.7)
self.foreground('circle', fill_alpha=1, line_alpha=0)
self.set_arc(N.DIRECTION, N.ASPECT_RATIO, delta_radius=0.2)
self.foreground('arc', fill_alpha=0, line_alpha=1)
self.show()
示例12: std_group_distance_climb_direction
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def std_group_distance_climb_direction(self):
n = int(self._df[N.GROUP].max()) + 1
palette = list(evenly_spaced_hues(n, saturation=0.2, stagger=7))
self.background('square', fill_alpha=0, line_alpha=1, color='#F0F0F0')
self.set_palette(N.GROUP, palette)
self.set_constant(CALENDAR_SIZE, 1)
self.foreground('square', fill_alpha=1, line_alpha=0)
self.set_size(N.ACTIVE_DISTANCE, min=0.2, max=0.8)
self.set_palette(N.TOTAL_CLIMB, K2W, gamma=0.3)
self.foreground('circle', fill_alpha=1, line_alpha=0)
self.foreground('circle', fill_alpha=0, line_alpha=1, color='black')
self.set_arc(N.DIRECTION, N.ASPECT_RATIO, delta_radius=0.2)
self.foreground('arc', fill_alpha=0, line_alpha=1, color='black')
self.show()
示例13: show
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def show(self):
self._plot.add_tools(*self._build_tools(self._df, *self._hover_args))
show(self._plot)
示例14: readMatLabFig_LandmarkMap
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def readMatLabFig_LandmarkMap(LandmarkMap_fn):
LandmarkMap=loadmat(LandmarkMap_fn, squeeze_me=True, struct_as_record=False)
y=loadmat(LandmarkMap_fn)
print(sorted(LandmarkMap.keys()))
LandmarkMap_dic={} #提取.fig值
for object_idx in range(LandmarkMap['hgS_070000'].children.children.shape[0]):
# print(object_idx)
try:
X=LandmarkMap['hgS_070000'].children.children[object_idx].properties.XData #good
Y=LandmarkMap['hgS_070000'].children.children[object_idx].properties.YData
LandmarkMap_dic[object_idx]=(X,Y)
except:
pass
# print(LandmarkMap_dic)
fig= plt.figure(figsize=(130,20))
colors=['#7f7f7f','#d62728','#1f77b4','','','']
markers=['.','+','o','','','']
dotSizes=[200,3000,3000,0,0,0]
linewidths=[2,10,10,0,0,0]
i=0
for key in LandmarkMap_dic.keys():
plt.scatter(LandmarkMap_dic[key][1],LandmarkMap_dic[key][0], s=dotSizes[i],marker=markers[i], color=colors[i],linewidth=linewidths[i])
i+=1
plt.tick_params(axis='both',labelsize=80)
plt.show()
return LandmarkMap_dic
#03-read PHMI values for evaluation of AVs' on-board lidar navigation 读取PHMI值
#the PHMI value less than pow(10,-5) is scaled to show clearly------on; the PHMI value larger than pow(10,-5) is scaled to show clearly------on
#数据类型A
示例15: singleBoxplot
# 需要导入模块: from bokeh import io [as 别名]
# 或者: from bokeh.io import show [as 别名]
def singleBoxplot(array):
import plotly.express as px
import pandas as pd
df=pd.DataFrame(array,columns=["value"])
fig = px.box(df, y="value",points="all")
# fig.show() #show in Jupyter
import plotly
plotly.offline.plot (fig) #works in spyder
#04-split curve into continuous parts based on the jumping position 使用1维卷积的方法,在曲线跳变点切分曲线