本文整理汇总了TypeScript中api/plotting.figure函数的典型用法代码示例。如果您正苦于以下问题:TypeScript figure函数的具体用法?TypeScript figure怎么用?TypeScript figure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了figure函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should allow fixed frame 200px x 200px in a layout with a title", async () => {
const fig0 = figure({frame_width: 200, frame_height: 200, title: "A title"})
fig0.circle([0, 5, 10], [0, 5, 10], {size: 10})
const fig1 = figure({frame_width: 200, frame_height: 200})
fig1.circle([0, 5, 10], [0, 5, 10], {size: 10})
const row = new Row({children: [fig0, fig1]})
await display(row, [600, 300])
})
示例2: figure
const fig = (location: Location | null, title?: string) => {
const p = figure({
width: 200, height: 200, tools: "pan,reset", title,
toolbar_location: location, title_location: location})
p.circle([0, 5, 10], [0, 5, 10], {size: 10})
return p
}
示例3: figure
return coeffs.map((xcoeff) => {
const fig = figure({plot_height: 200, plot_width: 200})
fig.xaxis.map((axis) => (axis.formatter as any).use_scientific = false)
fig.yaxis.map((axis) => (axis.formatter as any).use_scientific = false)
fig.xaxis.map((axis) => axis.major_label_orientation = "vertical")
fig.yaxis.map((axis) => axis.major_label_orientation = "horizontal")
fig.circle(values(xcoeff), values(ycoeff), {size: 5})
return fig
})
示例4: it
it("should allow fixed frame 300px x 300px", async () => {
const fig = figure({frame_width: 300, frame_height: 300})
fig.circle([0, 5, 10], [0, 5, 10], {size: 10})
await display(fig, [500, 500])
})