Lampese/mathplotlib/scene does not have a README file
pub(all) enum Anchor {
Named(String)
Fraction(Double, Double)
}pub struct Annotation {
x : Double
y : Double
text_x : Double
text_y : Double
value : String
xycoords : String
textcoords : String
connector : String
arrow : Bool
arrowcolor : String
linewidth : Double
head_length : Double
head_width : Double
style : Style
}pub(all) enum Artist {
Line(Array[Point], Style)
Scatter(Array[Point], Style)
PathCollection(PathCollection)
Bar(Array[Point], Style)
BarH(Array[Point], Style)
FillBetween(Array[Point], Array[Point], Style)
Polygon(Array[Point], Style)
CompoundPolygon(Array[Array[Point]], Style)
GouraudTriangle(Array[Point], Array[String])
HLine(Double, Style)
VLine(Double, Style)
AxLine(Point, Point, Style)
HSpan(Double, Double, Style)
VSpan(Double, Double, Style)
Text(Double, Double, String, Style)
Annotation(Annotation)
ErrorBar(Array[Point], Array[Double], Array[Double], Style)
Image(Array[Array[Double]], Double?, Double?, ColorMap)
ImageNorm(Array[Array[Double]], ColorNorm, ColorMap, ImageOrigin, (Double, Double, Double, Double)?, Double, ImageInterpolation)
ColorImage(Array[Array[Rgba]], ImageOrigin, (Double, Double, Double, Double)?, Double, ImageInterpolation)
Table(Table)
Pie(Array[Double], Array[String], Array[String], Double)
BoxPlot(Array[BoxStats], Bool, Style)
Quiver(Array[Point], Array[Point], Style)
Violin(Array[ViolinStats], Array[Double], Array[Double], Bool, ViolinSide, Bool, Bool, Bool, Style, Style, Double)
}fn Axes::annotate(self : Axes, value : String, x : Double, y : Double, offset_x? : Double, offset_y? : Double, arrow? : Bool, color? : String, arrowcolor? : String, linewidth? : Double, head_length? : Double, head_width? : Double, fontsize? : Int, xycoords? : String, textcoords? : String, connector? : String) -> Unit raise DataErrortest {
let fig = @scene.figure(width=400, height=200)
let ax = try! fig.add_axes(0.0, 0.0, 1.0, 1.0)
try! ax.plot([0.0, 1.0], [0.0, 1.0])
try! ax.set_xlim(0.0, 1.0)
try! ax.set_ylim(0.0, 1.0)
try! ax.set_aspect(1.0, adjustable="datalim")
try! ax.apply_aspect()
assert_eq(ax.get_xlim().unwrap().lower(), -0.5)
assert_eq(ax.get_position().unwrap().width(), 1.0)
}fn Axes::barbs_with_options(self : Axes, xs : Array[Double], ys : Array[Double], us : Array[Double], vs : Array[Double], color? : String, linewidth? : Double, barb_length? : Double, label? : String, half_increment? : Double, full_increment? : Double, flag_increment? : Double, rounding? : Bool, flip? : Bool, fill_empty? : Bool, pivot? : String) -> Unit raise DataErrorfn Axes::clabel(self : Axes, contours : ContourSet, inline? : Bool, fontsize? : Int, color? : String) -> Unit raise DataErrorfn Axes::contour(self : Axes, data : Array[Array[Double]], x? : Array[Double], y? : Array[Double], levels? : Array[Double], nlevels? : Int, color? : String, linewidth? : Double, label? : String, corner_mask? : Bool, locator? : Locator?, colors? : Array[String], linewidths? : Array[Double]) -> ContourSet raise DataErrorfn Axes::fill_between_masked(self : Axes, xs : MaskedArray, lower : MaskedArray, upper : MaskedArray, color? : String, label? : String) -> Unit raise DataErrorfn Axes::fill_betweenx_masked(self : Axes, ys : MaskedArray, left : MaskedArray, right : MaskedArray, color? : String, label? : String) -> Unit raise DataErrortest {
assert_eq(@scene.figure().axes().get_adjustable(), "box")
}test {
let ax = @scene.figure().axes()
assert_true(ax.get_anchor() is @scene.Anchor::Named("C"))
try! ax.set_anchor(@scene.Anchor::Fraction(0.25, 0.75))
assert_true(ax.get_anchor() is @scene.Anchor::Fraction(0.25, 0.75))
}test {
let ax = @scene.figure().axes()
assert_true(ax.get_aspect() is None)
ax.set_aspect_equal()
assert_eq(ax.get_aspect(), Some(1.0))
ax.set_aspect_auto()
assert_true(ax.get_aspect() is None)
}test {
let ax = @scene.figure().axes()
assert_true(ax.get_box_aspect() is None)
try! ax.set_box_aspect(aspect=2.0)
assert_eq(ax.get_box_aspect(), Some(2.0))
}test {
let fig = @scene.figure(width=400, height=200)
let ax = try! fig.add_axes(0.25, 0.25, 0.5, 0.5)
try! ax.set_xlim(0.0, 1.0)
try! ax.set_ylim(0.0, 1.0)
ax.set_aspect_equal()
assert_eq(ax.get_position(original=true).unwrap().width(), 0.5)
assert_eq(ax.get_position().unwrap().width(), 0.25)
}fn Axes::hexbin(self : Axes, xs : Array[Double], ys : Array[Double], values? : Array[Double], gridsize? : Int, mincnt? : Int, cmap? : String, vmin? : Double, vmax? : Double, color? : String, label? : String, reduce? : String, edgecolor? : String, linewidth? : Double, bins? : String, extent? : Array[Double], marginals? : Bool, reduce_fn? : HexbinReducer?) -> Hexbin raise DataErrorfn Axes::imshow_masked(self : Axes, data : MaskedMatrix, vmin? : Double, vmax? : Double, cmap? : String, origin? : String, extent? : Array[Double], aspect? : String, alpha? : Double, interpolation? : String) -> Unit raise DataErrortest {
let fig = @scene.figure()
let old = fig.axes()
assert_true(old.is_attached())
let panels = try! fig.subplots(1, 2)
assert_true(!old.is_attached())
assert_true(panels[0].is_attached())
}fn Axes::pcolor_grid_masked(self : Axes, data : MaskedMatrix, x : MaskedMatrix, y : MaskedMatrix, shading? : String, vmin? : Double, vmax? : Double, cmap? : String, antialiased? : Bool) -> Unit raise DataErrorfn Axes::pcolormesh_grid_masked(self : Axes, data : MaskedMatrix, x : MaskedMatrix, y : MaskedMatrix, shading? : String, vmin? : Double, vmax? : Double, cmap? : String, antialiased? : Bool) -> Unit raise DataErrorfn Axes::plot_masked(self : Axes, xs : MaskedArray, ys : MaskedArray, color? : String, label? : String) -> Unit raise DataErrortest {
let fig = @scene.figure()
let ax = try! fig.add_axes(0.25, 0.25, 0.5, 0.5)
ax.set_title("removed")
try! ax.remove()
assert_true(!fig.to_svg().contains(">removed<"))
assert_eq(ax.title(), Some("removed"))
}test {
let ax = try! @scene.figure().add_axes(0.25, 0.25, 0.5, 0.5)
try! ax.set_position(0.0, 0.0, 0.25, 0.25, which="active")
try! ax.reset_position()
assert_eq(ax.get_position().unwrap().x(), 0.25)
}fn Axes::scatter_masked(self : Axes, xs : MaskedArray, ys : MaskedArray, color? : String, label? : String) -> Unit raise DataErrorfn Axes::secondary_xaxis(self : Axes, forward : (Double) -> Double, inverse : (Double) -> Double, location? : SecondaryAxisLocation, transform? : Affine2D?) -> SecondaryAxis raise DataErrorfn Axes::secondary_yaxis(self : Axes, forward : (Double) -> Double, inverse : (Double) -> Double, location? : SecondaryAxisLocation, transform? : Affine2D?) -> SecondaryAxis raise DataErrortest {
let ax = @scene.figure().axes()
try! ax.set_adjustable("datalim")
assert_eq(ax.get_adjustable(), "datalim")
ax.clear()
assert_eq(ax.get_adjustable(), "datalim")
}test {
let ax = try! @scene.figure(width=400, height=200).add_axes(
0.25, 0.25, 0.5, 0.5,
)
try! ax.set_xlim(0.0, 1.0)
try! ax.set_ylim(0.0, 1.0)
ax.set_aspect_equal()
try! ax.set_anchor(@scene.Anchor::Named("SW"))
assert_eq(ax.get_position().unwrap().x(), 0.25)
try! ax.set_anchor(@scene.Anchor::Fraction(1.0, 0.5))
assert_eq(ax.get_position().unwrap().x(), 0.5)
}test {
let fig = @scene.figure(width=400, height=200)
let ax = try! fig.add_axes(0.25, 0.25, 0.5, 0.5)
try! ax.set_xlim(0.0, 1.0)
try! ax.set_ylim(0.0, 1.0)
try! ax.set_aspect(2.0)
assert_eq(ax.get_aspect(), Some(2.0))
assert_eq(ax.get_position().unwrap().width(), 0.125)
assert_eq(ax.get_position(original=true).unwrap().width(), 0.5)
}test {
let ax = try! @scene.figure(width=400, height=200).add_axes(
0.0, 0.0, 1.0, 1.0,
)
try! ax.set_box_aspect(aspect=1.0)
assert_eq(ax.get_position().unwrap().width(), 0.5)
assert_eq(ax.get_adjustable(), "datalim")
try! ax.set_box_aspect()
assert_eq(ax.get_position().unwrap().width(), 1.0)
}test {
let ax = @scene.figure(width=400, height=200).axes()
try! ax.set_position(0.25, 0.25, 0.5, 0.5)
let p = ax.get_position(original=true).unwrap()
assert_eq((p.x(), p.y(), p.width(), p.height()), (0.25, 0.25, 0.5, 0.5))
}test {
let axes = @scene.figure().axes()
try! axes.set_x_date_offset(345)
assert_eq(axes.x_date_offset(), 345)
}test {
let axes = @scene.figure().axes()
try! axes.set_y_date_offset(-210)
assert_eq(axes.y_date_offset(), -210)
}fn Axes::streamplot(self : Axes, xs : Array[Double], ys : Array[Double], us : Array[Array[Double]], vs : Array[Array[Double]], density? : Double, density_x? : Double, density_y? : Double, color? : String, linewidth? : Double, max_steps? : Int, minlength? : Double, start_points? : Array[Point], maxlength? : Double, integration_direction? : String, broken_streamlines? : Bool, integration_max_step_scale? : Double, integration_max_error_scale? : Double, arrows? : Bool, arrow_size? : Double, num_arrows? : Int, arrowstyle? : String, label? : String) -> StreamplotSet raise DataErrorfn Axes::streamplot_mesh(self : Axes, x_grid : Array[Array[Double]], y_grid : Array[Array[Double]], us : Array[Array[Double]], vs : Array[Array[Double]], density? : Double, density_x? : Double, density_y? : Double, color? : String, linewidth? : Double, max_steps? : Int, minlength? : Double, start_points? : Array[Point], maxlength? : Double, integration_direction? : String, broken_streamlines? : Bool, integration_max_step_scale? : Double, integration_max_error_scale? : Double, arrows? : Bool, arrow_size? : Double, num_arrows? : Int, arrowstyle? : String, label? : String) -> StreamplotSet raise DataErrorfn Axes::streamplot_with_style_grids(self : Axes, xs : Array[Double], ys : Array[Double], us : Array[Array[Double]], vs : Array[Array[Double]], linewidths? : Array[Array[Double]], color_values? : Array[Array[Double]], density? : Double, density_x? : Double, density_y? : Double, color? : String, linewidth? : Double, cmap? : String, vmin? : Double, vmax? : Double, max_steps? : Int, minlength? : Double, start_points? : Array[Point], maxlength? : Double, integration_direction? : String, broken_streamlines? : Bool, integration_max_step_scale? : Double, integration_max_error_scale? : Double, arrows? : Bool, arrow_size? : Double, num_arrows? : Int, arrowstyle? : String, label? : String) -> StreamplotSet raise DataErrorfn Axes::table(self : Axes, cell_text? : Array[Array[String]], cell_colours? : Array[Array[String]], cell_loc? : String, col_widths? : Array[Double], row_labels? : Array[String], row_colours? : Array[String], row_loc? : String, col_labels? : Array[String], col_colours? : Array[String], col_loc? : String, loc? : String, bbox? : Array[Double], edges? : String) -> Table raise DataErrorfn Axes::tricontour(self : Axes, xs : Array[Double], ys : Array[Double], triangles : Array[Array[Int]], values : Array[Double], levels? : Array[Double], nlevels? : Int, color? : String, linewidth? : Double, label? : String, mask? : Array[Bool], locator? : Locator?, colors? : Array[String], linewidths? : Array[Double]) -> ContourSet raise DataErrorfn Axes::tricontour_triangulation(self : Axes, mesh : Triangulation, values : Array[Double], levels? : Array[Double], nlevels? : Int, color? : String, linewidth? : Double, label? : String, locator? : Locator?, colors? : Array[String], linewidths? : Array[Double]) -> ContourSet raise DataErrorfn Axes::tricontourf(self : Axes, xs : Array[Double], ys : Array[Double], triangles : Array[Array[Int]], values : Array[Double], levels? : Array[Double], nlevels? : Int, colors? : Array[String], cmap? : String, label? : String, extend_mode? : String, mask? : Array[Bool], locator? : Locator?) -> ContourSet raise DataErrorfn Axes::tricontourf_triangulation(self : Axes, mesh : Triangulation, values : Array[Double], levels? : Array[Double], nlevels? : Int, colors? : Array[String], cmap? : String, label? : String, extend_mode? : String, locator? : Locator?) -> ContourSet raise DataErrorfn Axes::tripcolor_triangulation(self : Axes, mesh : Triangulation, values : Array[Double], vmin? : Double, vmax? : Double, cmap? : String, label? : String) -> Unit raise DataErrorfn Axes::triplot_triangulation(self : Axes, mesh : Triangulation, color? : String, linewidth? : Double, label? : String) -> Unit raise DataErrorfn Axes::violin(self : Axes, stats : Array[ViolinStats], positions? : Array[Double], width? : Double, widths? : Array[Double], horizontal? : Bool, side? : ViolinSide, showmeans? : Bool, showextrema? : Bool, showmedians? : Bool, color? : String, facecolor? : String, linecolor? : String, label? : String) -> Unit raise DataErrorfn Axes::violinplot(self : Axes, data : Array[Array[Double]], positions? : Array[Double], width? : Double, widths? : Array[Double], horizontal? : Bool, side? : ViolinSide, showmeans? : Bool, showextrema? : Bool, showmedians? : Bool, quantiles? : Array[Array[Double]], points? : Int, bandwidth? : ViolinBandwidth, color? : String, facecolor? : String, linecolor? : String, label? : String) -> Array[ViolinStats] raise DataErrortest {
let axes = @scene.figure().axes()
try! axes.set_x_date_format("%Y-%m-%d")
assert_eq(axes.x_date_format(), Some("%Y-%m-%d"))
}test {
assert_eq(@scene.figure().axes().x_date_offset(), 0)
}test {
let axes = @scene.figure().axes()
try! axes.set_y_date_format("%H:%M")
assert_eq(axes.y_date_format(), Some("%H:%M"))
}test {
assert_eq(@scene.figure().axes().y_date_offset(), 0)
}pub(all) enum ContainerKind {
Generic
Bar
ErrorBar
Stem
BoxPlot
Contour
Quiver
Violin
Pie
Stackplot
Streamplot
}fn Figure::add_axes(self : Figure, left : Double, bottom : Double, width : Double, height : Double) -> Axes raise LayoutErrortest {
let fig = @scene.figure(width=400, height=300)
let axes = try! fig.add_axes(0.1, 0.2, 0.5, 0.4)
let rect = axes.rect().unwrap()
assert_eq(
(rect.x(), rect.y(), rect.width(), rect.height()),
(40.0, 120.0, 200.0, 120.0),
)
}fn Figure::annotate(self : Figure, value : String, x : Double, y : Double, offset_x? : Double, offset_y? : Double, arrow? : Bool, color? : String, arrowcolor? : String, linewidth? : Double, head_length? : Double, head_width? : Double, fontsize? : Int, xycoords? : String, textcoords? : String, connector? : String) -> Unit raise DataErrorfn Figure::barbs_with_options(self : Figure, xs : Array[Double], ys : Array[Double], us : Array[Double], vs : Array[Double], color? : String, linewidth? : Double, barb_length? : Double, label? : String, half_increment? : Double, full_increment? : Double, flag_increment? : Double, rounding? : Bool, flip? : Bool, fill_empty? : Bool, pivot? : String) -> Unit raise DataErrorfn Figure::clabel(self : Figure, contours : ContourSet, inline? : Bool, fontsize? : Int, color? : String) -> Unit raise DataErrorfn Figure::contour(self : Figure, data : Array[Array[Double]], x? : Array[Double], y? : Array[Double], levels? : Array[Double], nlevels? : Int, color? : String, linewidth? : Double, label? : String, corner_mask? : Bool, locator? : Locator, colors? : Array[String], linewidths? : Array[Double]) -> ContourSet raise DataErrortest {
let fig = @scene.figure()
let ax = fig.axes()
try! fig.delaxes(ax)
assert_eq(fig.axes_list().length(), 0)
assert_true(!ax.is_attached())
assert_true(fig.gca().is_attached())
}fn Figure::fill_between_masked(self : Figure, xs : MaskedArray, lower : MaskedArray, upper : MaskedArray, color? : String, label? : String) -> Unit raise DataErrorfn Figure::fill_betweenx_masked(self : Figure, ys : MaskedArray, left : MaskedArray, right : MaskedArray, color? : String, label? : String) -> Unit raise DataErrortest {
let fig = @scene.figure()
let panels = try! fig.subplots(1, 2)
panels[1].set_title("last")
assert_eq(fig.gca().title(), Some("last"))
try! panels[1].remove()
panels[0].set_title("remaining")
assert_eq(fig.gca().title(), Some("remaining"))
}test {
assert_eq(@scene.figure().get_adjustable(), "box")
}test {
assert_true(@scene.figure().get_anchor() is @scene.Anchor::Named("C"))
}test {
let fig = @scene.figure()
fig.set_aspect_equal()
assert_eq(fig.get_aspect(), Some(1.0))
}test {
assert_true(@scene.figure().get_box_aspect() is None)
}fn Figure::hexbin(self : Figure, xs : Array[Double], ys : Array[Double], values? : Array[Double], gridsize? : Int, mincnt? : Int, cmap? : String, vmin? : Double, vmax? : Double, color? : String, label? : String, reduce? : String, edgecolor? : String, linewidth? : Double, bins? : String, extent? : Array[Double], marginals? : Bool, reduce_fn? : HexbinReducer) -> Hexbin raise DataErrortest {
let fig = @scene.figure()
fig.imshow([[0.0, 1.0]], interpolation="none")
assert_true(fig.to_svg().contains("data:image/png;base64,"))
}fn Figure::imshow_masked(self : Figure, data : MaskedMatrix, vmin? : Double, vmax? : Double, cmap? : String, origin? : String, extent? : Array[Double], aspect? : String, alpha? : Double, interpolation? : String) -> Unit raise DataErrorfn Figure::pcolor_grid_masked(self : Figure, data : MaskedMatrix, x : MaskedMatrix, y : MaskedMatrix, shading? : String, vmin? : Double, vmax? : Double, cmap? : String, antialiased? : Bool) -> Unit raise DataErrorfn Figure::pcolormesh_grid_masked(self : Figure, data : MaskedMatrix, x : MaskedMatrix, y : MaskedMatrix, shading? : String, vmin? : Double, vmax? : Double, cmap? : String, antialiased? : Bool) -> Unit raise DataErrorfn Figure::plot_masked(self : Figure, xs : MaskedArray, ys : MaskedArray, color? : String, label? : String) -> Unit raise DataErrortest {
let fig = @scene.figure()
let panels = try! fig.subplots(1, 2)
panels[0].set_title("first")
ignore(try! fig.sca(panels[0]))
assert_eq(fig.gca().title(), Some("first"))
assert_eq(fig.axes_list().length(), 2)
}fn Figure::scatter_masked(self : Figure, xs : MaskedArray, ys : MaskedArray, color? : String, label? : String) -> Unit raise DataErrorfn Figure::secondary_xaxis(self : Figure, forward : (Double) -> Double, inverse : (Double) -> Double, location? : SecondaryAxisLocation, transform? : Affine2D?) -> SecondaryAxis raise DataErrorfn Figure::secondary_yaxis(self : Figure, forward : (Double) -> Double, inverse : (Double) -> Double, location? : SecondaryAxisLocation, transform? : Affine2D?) -> SecondaryAxis raise DataErrortest {
let fig = @scene.figure()
try! fig.set_adjustable("datalim")
assert_eq(fig.axes().get_adjustable(), "datalim")
}test {
let fig = @scene.figure()
try! fig.set_anchor(@scene.Anchor::Named("NE"))
assert_true(fig.axes().get_anchor() is @scene.Anchor::Named("NE"))
}test {
let fig = @scene.figure()
try! fig.set_aspect(0.5)
assert_eq(fig.axes().get_aspect(), Some(0.5))
}test {
let fig = @scene.figure()
try! fig.set_box_aspect(aspect=0.5)
assert_eq(fig.axes().get_box_aspect(), Some(0.5))
}test {
let figure = @scene.figure()
try! figure.set_x_date_offset(120)
assert_eq(figure.x_axis().date_offset_minutes(), 120)
}fn Figure::set_x_minor_date_formatter(self : Figure, formatter : DateFormatter) -> Unit raise DataErrortest {
let figure = @scene.figure()
try! figure.set_y_date_offset(-480)
assert_eq(figure.y_axis().date_offset_minutes(), -480)
}fn Figure::set_y_minor_date_formatter(self : Figure, formatter : DateFormatter) -> Unit raise DataErrortest {
let fig = @scene.figure()
let artists = try! fig.stackplot(
[0.0, 1.0, 2.0],
[[1.0, 2.0, 1.0], [2.0, 1.0, 2.0]],
colors=["#123456", "#abcdef"],
)
assert_eq(artists.length(), 2)
assert_eq(fig.artists().length(), 2)
}fn Figure::streamplot(self : Figure, xs : Array[Double], ys : Array[Double], us : Array[Array[Double]], vs : Array[Array[Double]], density? : Double, density_x? : Double, density_y? : Double, color? : String, linewidth? : Double, max_steps? : Int, minlength? : Double, start_points? : Array[Point], maxlength? : Double, integration_direction? : String, broken_streamlines? : Bool, integration_max_step_scale? : Double, integration_max_error_scale? : Double, arrows? : Bool, arrow_size? : Double, num_arrows? : Int, arrowstyle? : String, label? : String) -> StreamplotSet raise DataErrorfn Figure::streamplot_mesh(self : Figure, x_grid : Array[Array[Double]], y_grid : Array[Array[Double]], us : Array[Array[Double]], vs : Array[Array[Double]], density? : Double, density_x? : Double, density_y? : Double, color? : String, linewidth? : Double, max_steps? : Int, minlength? : Double, start_points? : Array[Point], maxlength? : Double, integration_direction? : String, broken_streamlines? : Bool, integration_max_step_scale? : Double, integration_max_error_scale? : Double, arrows? : Bool, arrow_size? : Double, num_arrows? : Int, arrowstyle? : String, label? : String) -> StreamplotSet raise DataErrorfn Figure::streamplot_with_style_grids(self : Figure, xs : Array[Double], ys : Array[Double], us : Array[Array[Double]], vs : Array[Array[Double]], linewidths? : Array[Array[Double]], color_values? : Array[Array[Double]], density? : Double, density_x? : Double, density_y? : Double, color? : String, linewidth? : Double, cmap? : String, vmin? : Double, vmax? : Double, max_steps? : Int, minlength? : Double, start_points? : Array[Point], maxlength? : Double, integration_direction? : String, broken_streamlines? : Bool, integration_max_step_scale? : Double, integration_max_error_scale? : Double, arrows? : Bool, arrow_size? : Double, num_arrows? : Int, arrowstyle? : String, label? : String) -> StreamplotSet raise DataErrorfn Figure::subplots_adjust(self : Figure, left? : Double, bottom? : Double, right? : Double, top? : Double, wspace? : Double, hspace? : Double) -> Unit raise LayoutErrortest {
let fig = @scene.figure(width=400, height=300)
let axes = try! fig.subplots(1, 2)
try! fig.subplots_adjust(
left=0.25,
bottom=0.25,
right=0.75,
top=0.75,
wspace=0.5,
)
assert_eq(fig.subplot_bounds(), (0.25, 0.25, 0.75, 0.75))
match axes[0].rect() {
Some(rect) => assert_eq(rect.width(), 80.0)
None => fail("expected a subplot rectangle")
}
}fn Figure::table(self : Figure, cell_text? : Array[Array[String]], cell_colours? : Array[Array[String]], cell_loc? : String, col_widths? : Array[Double], row_labels? : Array[String], row_colours? : Array[String], row_loc? : String, col_labels? : Array[String], col_colours? : Array[String], col_loc? : String, loc? : String, bbox? : Array[Double], edges? : String) -> Table raise DataErrortest {
let fig = @scene.figure(width=400, height=200)
let ax = try! fig.add_axes(0.0, 0.0, 1.0, 1.0)
try! ax.plot([0.0, 1.0], [0.0, 1.0])
try! ax.set_xlim(0.0, 1.0)
try! ax.set_ylim(0.0, 1.0)
try! ax.set_aspect(1.0, adjustable="datalim")
let svg = try! fig.to_svg_checked()
assert_true(svg.contains("points=\"100,200 300,0\""))
}fn Figure::tricontour(self : Figure, xs : Array[Double], ys : Array[Double], triangles : Array[Array[Int]], values : Array[Double], levels? : Array[Double], nlevels? : Int, color? : String, linewidth? : Double, label? : String, mask? : Array[Bool], locator? : Locator, colors? : Array[String], linewidths? : Array[Double]) -> ContourSet raise DataErrorfn Figure::tricontour_triangulation(self : Figure, mesh : Triangulation, values : Array[Double], levels? : Array[Double], nlevels? : Int, color? : String, linewidth? : Double, label? : String, locator? : Locator, colors? : Array[String], linewidths? : Array[Double]) -> ContourSet raise DataErrorfn Figure::tricontourf(self : Figure, xs : Array[Double], ys : Array[Double], triangles : Array[Array[Int]], values : Array[Double], levels? : Array[Double], nlevels? : Int, colors? : Array[String], cmap? : String, label? : String, extend_mode? : String, mask? : Array[Bool], locator? : Locator) -> ContourSet raise DataErrorfn Figure::tricontourf_triangulation(self : Figure, mesh : Triangulation, values : Array[Double], levels? : Array[Double], nlevels? : Int, colors? : Array[String], cmap? : String, label? : String, extend_mode? : String, locator? : Locator) -> ContourSet raise DataErrorfn Figure::tripcolor_triangulation(self : Figure, mesh : Triangulation, values : Array[Double], vmin? : Double, vmax? : Double, cmap? : String, label? : String) -> Unit raise DataErrorfn Figure::triplot_triangulation(self : Figure, mesh : Triangulation, color? : String, linewidth? : Double, label? : String) -> Unit raise DataErrorfn Figure::violin(self : Figure, stats : Array[ViolinStats], positions? : Array[Double], width? : Double, widths? : Array[Double], horizontal? : Bool, side? : ViolinSide, showmeans? : Bool, showextrema? : Bool, showmedians? : Bool, color? : String, facecolor? : String, linecolor? : String, label? : String) -> Unit raise DataErrorfn Figure::violinplot(self : Figure, data : Array[Array[Double]], positions? : Array[Double], width? : Double, widths? : Array[Double], horizontal? : Bool, side? : ViolinSide, showmeans? : Bool, showextrema? : Bool, showmedians? : Bool, quantiles? : Array[Array[Double]], points? : Int, bandwidth? : ViolinBandwidth, color? : String, facecolor? : String, linecolor? : String, label? : String) -> Array[ViolinStats] raise DataErrorpub(all) enum ImageInterpolation {
Nearest
NoInterpolation
Bilinear
Bicubic
Spline16
Spline36
Hanning
Hamming
Hermite
Kaiser
Quadric
Catrom
Gaussian
Bessel
Mitchell
Sinc
Lanczos
Blackman
Auto
Antialiased
}pub(all) enum ImageOrigin {
Upper
Lower
}pub(all) enum LegendKind {
Line
Marker
Patch
}pub struct Line2D {
// private fields
}pub struct SecondaryAxis {
label : String?
// private fields
}fn SecondaryAxis::formatter_offset_label_checked(self : SecondaryAxis, values : Array[Double], view? : Limits) -> String raise DataErrorfn SecondaryAxis::formatter_tick_locations_checked(self : SecondaryAxis, minor? : Bool) -> FormatterLocations raise DataErrorfn SecondaryAxis::minor_tick_labels_checked(self : SecondaryAxis, values : Array[Double], view? : Limits) -> Array[String] raise DataErrorfn SecondaryAxis::set_alignment(self : SecondaryAxis, alignment : SecondaryAxisAlignment) -> Unit raise DataErrorfn SecondaryAxis::set_functions(self : SecondaryAxis, forward : (Double) -> Double, inverse : (Double) -> Double) -> Unit raise DataErrorfn SecondaryAxis::set_location(self : SecondaryAxis, location : SecondaryAxisLocation, transform? : Affine2D?) -> Unit raise DataErrorfn SecondaryAxis::set_minor_named_formatter(self : SecondaryAxis, formatter : BaseFormatter) -> Unitfn SecondaryAxis::tick_labels_checked(self : SecondaryAxis, values : Array[Double], view? : Limits) -> Array[String] raise DataErrorpub(all) enum SecondaryAxisAlignment {
Top
Bottom
Left
Right
}pub(all) enum SecondaryAxisLocation {
Top
Bottom
Left
Right
Position(Double)
}pub(all) enum SpinePosition {
Axes
Data(Double)
Outward(Double)
}pub(all) enum SpineSide {
Left
Right
Bottom
Top
}test {
let fig = @scene.figure()
let grid = try! fig.grid_spec(1, 1)
let sub = fig.add_subfigure(try! grid.cell_spec(0, 0))
let ax = try! sub.subplots(1, 1)[0]
try! sub.delaxes(ax)
assert_eq(sub.axes_list().length(), 0)
assert_eq(fig.axes_list().length(), 0)
}type SubFigureDatapub struct TableCell {
row : Int
column : Int
text : String
facecolor : String
edgecolor : String
align : String
visible_edges : String
}pub(all) enum ViolinBandwidth {
Scott
Silverman
Fixed(Double)
}pub(all) enum ViolinSide {
Both
Low
High
}fn violin_stats(values : Array[Double], points? : Int, bandwidth? : ViolinBandwidth, quantiles? : Array[Double]) -> ViolinStats raise DataError