Figure

org.appliedtopology.tda4j.plot.Figure
final case class Figure(marks: Vector[Mark] = ..., title: String = ..., subtitle: String = ..., x: Axis = ..., y: Axis = ..., legend: Vector[LegendItem] = ..., colorScale: Option[ColorScale] = ..., width: Int = ..., height: Int = ..., equalAspect: Boolean = ..., aspect: Option[Double] = ..., palette: Palette = ..., style: Style = ..., degrees: Map[Int, DegreeStyle] = ..., legendTitle: String = ..., elements: Elements = ..., legendPlace: LegendPosition = ..., caption: String = ..., tag: String = ..., description: String = ...) extends Plot

A 2-D figure: marks in data coordinates, two axes, a legend, an optional color scale. Immutable: + adds a mark or a Tweak (labels, scales, size, palette, style), ++ more marks, copy changes the rest. svg renders it (Svg); view() shows it live; save("f.svg") writes it.

The parts follow the grammar of graphics: the marks are the data drawn, x and y the position scales, palette with degrees and colorScale the color scales, legend and the color bar their guides, style the look and elements its finer parts (each text, the lines, the plot area). legendPlace is where the plot puts its legend unless the style says otherwise. equalAspect keeps a unit of x as long as a unit of y when both axes are on one scale, and aspect is any other ratio of the length of a y unit to an x unit (Scale.aspect). caption is a line of text under the plot, tag the letter of a panel of a board, and description what a screen reader says of the plot (the `` of the SVG).

Attributes

Experimental
true
Source
Figure.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Plot
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def +(mark: Mark): Figure

Attributes

Source
Figure.scala
def +(tweak: Tweak): Figure

This figure with the change tweak makes: fig + Labels(title = "A circle") + Scale.xy(Transform.Log10).

This figure with the change tweak makes: fig + Labels(title = "A circle") + Scale.xy(Transform.Log10).

Attributes

Source
Figure.scala
def ++(more: IterableOnce[Mark]): Figure

Attributes

Source
Figure.scala
def fragment(theme: Theme = ...): String

The plot as a fragment to embed in a page (an ``, or a `

The plot as a fragment to embed in a page (an ``, or a `

` with its own script for 3-D).

Attributes

Source
Figure.scala
def html(theme: Theme = ...): String

A complete HTML page, following the reader's light or dark setting under Theme.Auto.

A complete HTML page, following the reader's light or dark setting under Theme.Auto.

Attributes

Source
Figure.scala
def over(under: Figure): Figure

This figure's marks drawn over under's (axes, title, legend heading and look from this one, legends merged; the color scale of whichever has one).

This figure's marks drawn over under's (axes, title, legend heading and look from this one, legends merged; the color scale of whichever has one).

Attributes

Source
Figure.scala
def ranges: ((Double, Double), (Double, Double))

The visible range of each axis in data units, ((xMin, xMax), (yMin, yMax)), as svg will draw it before any adjustment for an equal aspect ratio.

The visible range of each axis in data units, ((xMin, xMax), (yMin, yMax)), as svg will draw it before any adjustment for an equal aspect ratio.

Attributes

Source
Figure.scala
def svg(theme: Theme = ...): String

Attributes

Source
Figure.scala
def svgFile(theme: Theme): String

A complete SVG document in plain colors (for a 3-D scene: one fixed view), with no background unless the style asks for one (Style.print, or Style.transparent = false), so that it takes the color of the page it goes onto.

A complete SVG document in plain colors (for a 3-D scene: one fixed view), with no background unless the style asks for one (Style.print, or Style.transparent = false), so that it takes the color of the page it goes onto.

Attributes

Source
Figure.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Figure.scala
def withAspect(ratio: Optional[Double] = ..., free: Optional[Boolean] = ...): Figure

The aspect ratio of the plot area: withAspect(1) for equal units, withAspect(free = true) for none. See Scale.aspect.

The aspect ratio of the plot area: withAspect(1) for equal units, withAspect(free = true) for none. See Scale.aspect.

Attributes

Source
Figure.scala
def withAspect(ratio: Double): Figure

The aspect ratio as a number, for MATLAB and Java: withAspect(1) for equal units.

The aspect ratio as a number, for MATLAB and Java: withAspect(1) for equal units.

Attributes

Source
Figure.scala
def withAxisLines(width: Optional[Double] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., dash: Optional[Dash] = ..., opacity: Optional[Double] = ..., visible: Optional[Boolean] = ...): Figure

The axis lines. See Lines.axis.

The axis lines. See Lines.axis.

Attributes

Source
Figure.scala
def withCaption(text: String): Figure

A line of text under the plot.

A line of text under the plot.

Attributes

Source
Figure.scala
def withColorLabel(text: String): Figure

The title of the color bar.

The title of the color bar.

Attributes

Source
Figure.scala
def withColorScale(min: Optional[Double] = ..., max: Optional[Double] = ..., transform: Optional[Transform] = ..., stops: Optional[Seq[String]] = ..., guide: Optional[Boolean] = ...): Figure

The color scale of a heatmap or a cocycle, if the figure has one. See Scale.color.

The color scale of a heatmap or a cocycle, if the figure has one. See Scale.color.

Attributes

Source
Figure.scala
def withDegree(k: Int, color: Optional[String] = ..., darkColor: Optional[String] = ..., label: Optional[String] = ..., shape: Optional[Shape] = ..., marker: Optional[MarkerStyle] = ...): Figure

The color, legend label and marker of homological degree k. See Scale.degree.

The color, legend label and marker of homological degree k. See Scale.degree.

Attributes

Source
Figure.scala
def withDegreeColor(degree: Int, color: String): Figure

The color of homological degree degree, as a CSS color (#d62728, tomato).

The color of homological degree degree, as a CSS color (#d62728, tomato).

Attributes

Source
Figure.scala
def withDegreeLabel(degree: Int, label: String): Figure

The legend label of homological degree degree.

The legend label of homological degree degree.

Attributes

Source
Figure.scala
def withDescription(text: String): Figure

What a screen reader says of the plot (the `` of the SVG).

What a screen reader says of the plot (the `` of the SVG).

Attributes

Source
Figure.scala
def withDiagonal(shade: Optional[Boolean] = ..., shadeColor: Optional[String] = ..., shadePaint: Optional[Paint] = ..., shadeOpacity: Optional[Double] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., width: Optional[Double] = ..., dashed: Optional[Boolean] = ...): Figure

The diagonal of a persistence diagram and its shaded half plane. See Guide.diagonal.

The diagonal of a persistence diagram and its shaded half plane. See Guide.diagonal.

Attributes

Source
Figure.scala
def withDiscs(opacity: Optional[Double] = ...): Figure

The discs (the balls of a Cech or alpha complex): opacity. See Geom.discs.

The discs (the balls of a Cech or alpha complex): opacity. See Geom.discs.

Attributes

Source
Figure.scala
def withFrame(width: Optional[Double] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., dash: Optional[Dash] = ..., opacity: Optional[Double] = ..., visible: Optional[Boolean] = ...): Figure

A frame around the plot area (drawn once any setting is given). See Lines.frame.

A frame around the plot area (drawn once any setting is given). See Lines.frame.

Attributes

Source
Figure.scala
def withGridLines(width: Optional[Double] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., dash: Optional[Dash] = ..., opacity: Optional[Double] = ..., visible: Optional[Boolean] = ...): Figure

The gridlines: width, color, dash, opacity. See Lines.grid.

The gridlines: width, color, dash, opacity. See Lines.grid.

Attributes

Source
Figure.scala
def withLabels(title: Optional[String] = ..., subtitle: Optional[String] = ..., x: Optional[String] = ..., y: Optional[String] = ..., legend: Optional[String] = ..., color: Optional[String] = ..., caption: Optional[String] = ..., tag: Optional[String] = ..., description: Optional[String] = ...): Figure

The words: only what is given changes (withLabels(x = "birth") leaves the title). See Labels.

The words: only what is given changes (withLabels(x = "birth") leaves the title). See Labels.

Attributes

Source
Figure.scala
def withLegend(position: String): Figure

The legend at right, bottom, or none.

The legend at right, bottom, or none.

Attributes

Source
Figure.scala
def withLegendBox(box: Optional[Boolean] = ..., background: Optional[String] = ..., backgroundPaint: Optional[Paint] = ..., opacity: Optional[Double] = ..., frame: Optional[Boolean] = ..., frameColor: Optional[String] = ..., framePaint: Optional[Paint] = ..., frameWidth: Optional[Double] = ..., padding: Optional[Double] = ..., columns: Optional[Int] = ...): Figure

A box round the legend and its entries in columns: withLegendBox(background = "white", frame = true, columns = 2). See Guide.legend.

A box round the legend and its entries in columns: withLegendBox(background = "white", frame = true, columns = 2). See Guide.legend.

Attributes

Source
Figure.scala
def withLegendBox(color: String): Figure

A box round the legend, filled with color (a CSS color) and framed: withLegendBox("white").

A box round the legend, filled with color (a CSS color) and framed: withLegendBox("white").

Attributes

Source
Figure.scala
def withLegendColumns(columns: Int): Figure

The legend's entries in columns columns, one filled before the next.

The legend's entries in columns columns, one filled before the next.

Attributes

Source
Figure.scala
def withLegendTitle(text: String): Figure

The heading over the legend's entries.

The heading over the legend's entries.

Attributes

Source
Figure.scala
def withLines(width: Optional[Double] = ...): Figure

The polylines (a cycle, a landscape): width. See Geom.lines.

The polylines (a cycle, a landscape): width. See Geom.lines.

Attributes

Source
Figure.scala
def withLocale(tag: String): Figure

The decimal separator and minus sign of a locale (withLocale("de")). See Numbers.locale.

The decimal separator and minus sign of a locale (withLocale("de")). See Numbers.locale.

Attributes

Source
Figure.scala
def withMarkScale(factor: Double): Figure

A factor on the size of markers and the width of lines.

A factor on the size of markers and the width of lines.

Attributes

Source
Figure.scala
def withMinorGridLines(width: Optional[Double] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., dash: Optional[Dash] = ..., opacity: Optional[Double] = ..., visible: Optional[Boolean] = ...): Figure

Minor gridlines between the ticks (drawn once any setting is given). See Lines.minorGrid.

Minor gridlines between the ticks (drawn once any setting is given). See Lines.minorGrid.

Attributes

Source
Figure.scala
def withMinorTickMarks(length: Optional[Double] = ..., direction: Optional[TickDirection] = ..., width: Optional[Double] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., opacity: Optional[Double] = ..., visible: Optional[Boolean] = ...): Figure

Minor tick marks between the major ones. See Lines.minorTicks.

Minor tick marks between the major ones. See Lines.minorTicks.

Attributes

Source
Figure.scala
def withNumbers(decimal: Optional[String] = ..., grouping: Optional[String] = ..., minus: Optional[String] = ...): Figure

How the numbers of tick labels and the color bar are written. See Numbers.

How the numbers of tick labels and the color bar are written. See Numbers.

Attributes

Source
Figure.scala

With its palette's surface as the background in a saved file too, where it has none unless asked.

With its palette's surface as the background in a saved file too, where it has none unless asked.

Attributes

Source
Figure.scala
def withPalette(palette: Palette): Figure

This palette.

This palette.

Attributes

Source
Figure.scala
def withPalette(name: String): Figure

The palette called name: brand, reference, print, grayscale, okabe-ito or clear.

The palette called name: brand, reference, print, grayscale, okabe-ito or clear.

Attributes

Source
Figure.scala
def withPanel(color: Optional[String] = ..., paint: Optional[Paint] = ..., opacity: Optional[Double] = ..., visible: Optional[Boolean] = ...): Figure

The fill of the plot area. See Guide.panel.

The fill of the plot area. See Guide.panel.

Attributes

Source
Figure.scala
def withPoints(shape: Optional[Shape] = ..., size: Optional[Double] = ..., opacity: Optional[Double] = ..., fill: Optional[Boolean] = ..., edgeWidth: Optional[Double] = ..., edgeColor: Optional[String] = ..., edgePaint: Optional[Paint] = ..., edgeOpacity: Optional[Double] = ..., edgeDash: Optional[Dash] = ..., edgeVisible: Optional[Boolean] = ...): Figure

The markers of the points: withPoints(size = 3.5, opacity = 0.6, edgeVisible = false). See Geom.points.

The markers of the points: withPoints(size = 3.5, opacity = 0.6, edgeVisible = false). See Geom.points.

Attributes

Source
Figure.scala
def withPolygons(opacity: Optional[Double] = ...): Figure

The filled polygons (a complex's triangles): opacity. See Geom.polygons.

The filled polygons (a complex's triangles): opacity. See Geom.polygons.

Attributes

Source
Figure.scala
def withSegments(width: Optional[Double] = ..., opacity: Optional[Double] = ...): Figure

The line segments (a barcode's bars): width, opacity. See Geom.segments.

The line segments (a barcode's bars): width, opacity. See Geom.segments.

Attributes

Source
Figure.scala
def withSetting(spec: String): Figure

One change written as text, element.property=value: withSetting("title.size=18"), withSetting("tick-label.angle=45"), withSetting("grid.dash=dotted"), withSetting("x-axis=top"). See Settings for the elements and their properties.

One change written as text, element.property=value: withSetting("title.size=18"), withSetting("tick-label.angle=45"), withSetting("grid.dash=dotted"), withSetting("x-axis=top"). See Settings for the elements and their properties.

Attributes

Source
Figure.scala
def withSize(width: Optional[Int] = ..., height: Optional[Int] = ...): Figure

The size in pixels; give one to keep the other (withSize(width = 900)).

The size in pixels; give one to keep the other (withSize(width = 900)).

Attributes

Source
Figure.scala
def withSize(width: Int, height: Int): Figure

The size in pixels.

The size in pixels.

Attributes

Source
Figure.scala
def withStyle(style: Style): Figure

This style, in place of the figure's.

This style, in place of the figure's.

Attributes

Source
Figure.scala
def withStyle(name: String): Figure

The style called name: default, slides, print or clear.

The style called name: default, slides, print or clear.

Attributes

Source
Figure.scala
def withSubtitle(text: String): Figure

The line under the heading.

The line under the heading.

Attributes

Source
Figure.scala
def withTag(text: String): Figure

The letter or number of a panel, in the corner of the figure: "(a)".

The letter or number of a panel, in the corner of the figure: "(a)".

Attributes

Source
Figure.scala
def withText(role: TextRole, size: Optional[Double] = ..., weight: Optional[Weight] = ..., italic: Optional[Boolean] = ..., align: Optional[Anchor] = ..., angle: Optional[Double] = ..., font: Optional[String] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., limit: Optional[Double] = ...): Figure

The look of one kind of text: withText(TextRole.Title, size = 18, align = Anchor.Middle). See Text.

The look of one kind of text: withText(TextRole.Title, size = 18, align = Anchor.Middle). See Text.

Attributes

Source
Figure.scala
def withTextScale(factor: Double): Figure

A factor on every text size (1.3 for a slide).

A factor on every text size (1.3 for a slide).

Attributes

Source
Figure.scala
def withTickMarks(length: Optional[Double] = ..., direction: Optional[TickDirection] = ..., width: Optional[Double] = ..., color: Optional[String] = ..., paint: Optional[Paint] = ..., opacity: Optional[Double] = ..., visible: Optional[Boolean] = ...): Figure

Tick marks at the major ticks: withTickMarks(length = 4). See Lines.ticks.

Tick marks at the major ticks: withTickMarks(length = 4). See Lines.ticks.

Attributes

Source
Figure.scala
def withTitle(text: String): Figure

The heading.

The heading.

Attributes

Source
Figure.scala

Without a background, so that the figure takes the color of the page behind it, in a saved file and on a page.

Without a background, so that the figure takes the color of the page behind it, in a saved file and on a page.

Attributes

Source
Figure.scala
def withXCrossesAt(value: Double): Figure

The x axis drawn through y = value (see Scale.x), for MATLAB and Java: withXCrossesAt(0).

The x axis drawn through y = value (see Scale.x), for MATLAB and Java: withXCrossesAt(0).

Attributes

Source
Figure.scala
def withXLabel(text: String): Figure

The x axis label.

The x axis label.

Attributes

Source
Figure.scala
def withXRange(min: Double, max: Double): Figure

The visible range of the x axis, in data units.

The visible range of the x axis, in data units.

Attributes

Source
Figure.scala
def withXScale(transform: Optional[Transform] = ..., min: Optional[Double] = ..., max: Optional[Double] = ..., breaks: Optional[Seq[Double]] = ..., format: Optional[String] = ..., grid: Optional[Boolean] = ..., visible: Optional[Boolean] = ..., minusInfinity: Optional[Boolean] = ..., position: Optional[Side] = ..., reverse: Optional[Boolean] = ..., padding: Optional[Double] = ..., crossesAt: Optional[Double] = ...): Figure

The x axis: its scale, visible range, ticks, number format, gridlines, and its side (Side.Top). See Scale.x.

The x axis: its scale, visible range, ticks, number format, gridlines, and its side (Side.Top). See Scale.x.

Attributes

Source
Figure.scala
def withXScale(name: String): Figure

The x axis on the scale called name: linear, log, sqrt or symlog.

The x axis on the scale called name: linear, log, sqrt or symlog.

Attributes

Source
Figure.scala
def withXYScale(transform: Optional[Transform] = ..., min: Optional[Double] = ..., max: Optional[Double] = ..., breaks: Optional[Seq[Double]] = ..., format: Optional[String] = ..., grid: Optional[Boolean] = ..., visible: Optional[Boolean] = ..., minusInfinity: Optional[Boolean] = ..., reverse: Optional[Boolean] = ..., padding: Optional[Double] = ...): Figure

Both axes alike: a log-log diagram is withXYScale(Transform.Log10).

Both axes alike: a log-log diagram is withXYScale(Transform.Log10).

Attributes

Source
Figure.scala
def withYCrossesAt(value: Double): Figure

The y axis drawn through x = value (see Scale.y), for MATLAB and Java: withYCrossesAt(0).

The y axis drawn through x = value (see Scale.y), for MATLAB and Java: withYCrossesAt(0).

Attributes

Source
Figure.scala
def withYLabel(text: String): Figure

The y axis label.

The y axis label.

Attributes

Source
Figure.scala
def withYRange(min: Double, max: Double): Figure

The visible range of the y axis, in data units.

The visible range of the y axis, in data units.

Attributes

Source
Figure.scala
def withYScale(transform: Optional[Transform] = ..., min: Optional[Double] = ..., max: Optional[Double] = ..., breaks: Optional[Seq[Double]] = ..., format: Optional[String] = ..., grid: Optional[Boolean] = ..., visible: Optional[Boolean] = ..., minusInfinity: Optional[Boolean] = ..., position: Optional[Side] = ..., reverse: Optional[Boolean] = ..., padding: Optional[Double] = ..., crossesAt: Optional[Double] = ...): Figure

The y axis; as withXScale.

The y axis; as withXScale.

Attributes

Source
Figure.scala
def withYScale(name: String): Figure

The y axis on the scale called name: linear, log, sqrt or symlog.

The y axis on the scale called name: linear, log, sqrt or symlog.

Attributes

Source
Figure.scala

Without gridlines.

Without gridlines.

Attributes

Source
Figure.scala

Inherited methods

def fragment(theme: String): String

fragment in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (Python: a notebook shows an interactive plot by its fragment).

fragment in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (Python: a notebook shows an interactive plot by its fragment).

Attributes

Inherited from:
Plot
Source
Plot.scala
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala
def save(path: String, theme: String): String

save in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (MATLAB: fig.save('diagram.svg', 'dark')).

save in the theme called theme (auto, light or dark), for callers that have a word, not a Theme (MATLAB: fig.save('diagram.svg', 'dark')).

Attributes

Inherited from:
Plot
Source
Plot.scala
def save(path: String): String

save in the default theme for the file type, for callers that cannot use a default argument (Java, MATLAB: fig.save('diagram.svg')).

save in the default theme for the file type, for callers that cannot use a default argument (Java, MATLAB: fig.save('diagram.svg')).

Attributes

Inherited from:
Plot
Source
Plot.scala
def save(path: String, theme: Option[Theme] = ...): String

Writes the plot to path: an .svg file in plain light colors with no background (another theme on request; see svgFile), or an .html page (interactive for 3-D) that follows the reader's light or dark setting and has its background. Returns the absolute path.

Writes the plot to path: an .svg file in plain light colors with no background (another theme on request; see svgFile), or an .html page (interactive for 3-D) that follows the reader's light or dark setting and has its background. Returns the absolute path.

Attributes

Inherited from:
Plot
Source
Plot.scala
def view(): this.type

Shows the plot in the live viewer, a browser tab that adds every plot view()ed (see Viewer). Inside Plot.viewWith the plot goes to the program that hosts the session instead.

Shows the plot in the live viewer, a browser tab that adds every plot view()ed (see Viewer). Inside Plot.viewWith the plot goes to the program that hosts the session instead.

Attributes

Inherited from:
Plot
Source
Plot.scala