本文整理匯總了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])
})