Scale

org.appliedtopology.tda4j.plot.Scale
object Scale

Scales: how data become positions, colors and marks. The tweaks that change them:

  • Scale.x, Scale.y, Scale.xy: an axis's transform (log, square root), limits, tick positions and number format, gridlines;
  • Scale.color: the limits, the colors and the transform of a color scale (a heatmap, a cocycle's values);
  • Scale.degree: the color, label and marker shape of a homological degree.

Every argument is optional, and only what is given changes.

Attributes

Experimental
true
Source
Tweak.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Scale.type

Members list

Value members

Concrete methods

def aspect(ratio: Optional[Double] = ..., free: Optional[Boolean] = ...): Tweak

The aspect ratio of the plot area: ratio is how many times as long a unit of y is as a unit of x (1 is equal units, a circle round), the plot widening a range to keep it; free = true gives it up. Units are those of the axes' scales, so on a log axis a decade is a unit. The plots that draw geometry (a complex, a diagram) begin with equal units where both axes share a scale.

The aspect ratio of the plot area: ratio is how many times as long a unit of y is as a unit of x (1 is equal units, a circle round), the plot widening a range to keep it; free = true gives it up. Units are those of the axes' scales, so on a log axis a decade is a unit. The plots that draw geometry (a complex, a diagram) begin with equal units where both axes share a scale.

Attributes

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

The figure's color scale, if it has one (a heatmap, a persistence image, a cocycle, circular coordinates; any other figure is left as it is). min and max set the values at the ends of the ramp, so that two figures can share one scale; for a diverging scale (a cocycle) max alone, the scale being symmetric about zero. stops replaces a sequential ramp's colors (ColorScale.viridis); guide = false hides the color bar.

The figure's color scale, if it has one (a heatmap, a persistence image, a cocycle, circular coordinates; any other figure is left as it is). min and max set the values at the ends of the ramp, so that two figures can share one scale; for a diverging scale (a cocycle) max alone, the scale being symmetric about zero. stops replaces a sequential ramp's colors (ColorScale.viridis); guide = false hides the color bar.

Attributes

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

Homological degree k (a categorical slot, the k-th landscape in Plot.landscape): its color (in dark mode darkColor, default the same), its legend label (the tooltips keep H1) and its marker shape. The color follows the degree through the whole figure, whatever palette it has. marker changes how the degree's markers look (their size, opacity, whether they are open, their edge) over the figure's own: marker = MarkerStyle(size = Some(3.5), fill = Some(false)).

Homological degree k (a categorical slot, the k-th landscape in Plot.landscape): its color (in dark mode darkColor, default the same), its legend label (the tooltips keep H1) and its marker shape. The color follows the degree through the whole figure, whatever palette it has. marker changes how the degree's markers look (their size, opacity, whether they are open, their edge) over the figure's own: marker = MarkerStyle(size = Some(3.5), fill = Some(false)).

Attributes

Source
Tweak.scala
def x(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] = ...): Tweak

The x axis. min and max are the ends of the visible range in data units (give one to move one end); breaks the tick positions; format a printf pattern for the tick numbers ("%.1f", "%.0f%%"); grid and visible turn the gridlines and the whole axis (ticks, labels, line) on or off. On a log axis what is at 0 (an H0 bar's birth) sits on a -∞ line below the lowest number: minusInfinity = false leaves it out and counts it instead, true keeps the line even with nothing on it (panels that must line up). position puts the axis at the Side.Top of the plot (or back at the Side.Bottom); reverse = true runs it the other way; padding is the fraction of the data's extent left empty at each end (default 0.04) when min and max do not fix them. crossesAt draws the axis where the y axis has that value, in y's data units: Scale.x(crossesAt = 0) is the x axis through y = 0, with its numbers beside it and its label at the edge of the plot. A value the y axis does not show (or cannot place, 0 on a log axis) leaves the axis at the edge, and the plot says so.

The x axis. min and max are the ends of the visible range in data units (give one to move one end); breaks the tick positions; format a printf pattern for the tick numbers ("%.1f", "%.0f%%"); grid and visible turn the gridlines and the whole axis (ticks, labels, line) on or off. On a log axis what is at 0 (an H0 bar's birth) sits on a -∞ line below the lowest number: minusInfinity = false leaves it out and counts it instead, true keeps the line even with nothing on it (panels that must line up). position puts the axis at the Side.Top of the plot (or back at the Side.Bottom); reverse = true runs it the other way; padding is the fraction of the data's extent left empty at each end (default 0.04) when min and max do not fix them. crossesAt draws the axis where the y axis has that value, in y's data units: Scale.x(crossesAt = 0) is the x axis through y = 0, with its numbers beside it and its label at the edge of the plot. A value the y axis does not show (or cannot place, 0 on a log axis) leaves the axis at the edge, and the plot says so.

Attributes

Source
Tweak.scala
def xy(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] = ...): Tweak

Both axes alike: a log-log persistence diagram is Scale.xy(Transform.Log10).

Both axes alike: a log-log persistence diagram is Scale.xy(Transform.Log10).

Attributes

Source
Tweak.scala
def y(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] = ...): Tweak

The y axis; as x, with position the Side.Left or Side.Right of the plot, and crossesAt the value of the x axis, in x's data units, that the y axis goes through.

The y axis; as x, with position the Side.Left or Side.Right of the plot, and crossesAt the value of the x axis, in x's data units, that the y axis goes through.

Attributes

Source
Tweak.scala