Class/Object

co.theasi.plotly

GridFigure

Related Docs: object GridFigure | package plotly

Permalink

case class GridFigure(plots: Vector[Plot], viewPorts: Vector[ViewPort], numberRows: Int, numberColumns: Int, options: FigureOptions) extends Figure with Product with Serializable

Figure containing plots arranged on a grid.

This Figure subclass is designed for equally spaced subplots on a grid. Use the companion object's apply method to construct a new instance, specifying the number of rows and columns. For instance, val figure = GridFigure(2, 3) will build a new figure with 6 subplots, arranged in a grid with two rows and three columns. You can then use the plot method to set the content of specific sub-plots.

import util.Random
val xs = (0 to 100).map { i => Random.nextGaussian }
val ys = (0 to 100).map { i => Random.nextGaussian }
val ys2 = (0 to 100).map { i => Random.nextGaussian }
val ys3 = (0 to 100).map { i => Random.nextGaussian }

val figure = GridFigure(2, 3) // 2 rows, 3 columns
  .plot(0, 0) { CartesianPlot().withScatter(xs, ys) } // top left
  .plot(0, 1) { CartesianPlot().withScatter(xs, ys2) } // top middle
  .plot(1, 2) { CartesianPlot().withScatter(xs, ys3) } // bottom right
  .title("My grid figure")

draw(figure, "grid-figure")
Linear Supertypes
Serializable, Serializable, Product, Equals, Figure, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GridFigure
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Figure
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new GridFigure(plots: Vector[Plot], viewPorts: Vector[ViewPort], numberRows: Int, numberColumns: Int, options: FigureOptions)

    Permalink

Type Members

  1. type Self = GridFigure

    Permalink
    Definition Classes
    GridFigureFigure

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def bottomMargin(newBottomMargin: Int): Self

    Permalink

    Set bottom margin (in px)

    Set bottom margin (in px)

    Definition Classes
    Figure
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def height(newHeight: Int): Self

    Permalink

    Set the plot height (in px)

    Set the plot height (in px)

    Definition Classes
    Figure
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. def leftMargin(newLeftMargin: Int): Self

    Permalink

    Set left margin (in px)

    Set left margin (in px)

    Definition Classes
    Figure
  13. def legend(newLegend: LegendOptions): Self

    Permalink

    Set legend options

    Set legend options

    val legend = LegendOptions().fontSize(20)
    val figure = Figure().legend(legend)
    Definition Classes
    Figure
  14. def margins(top: Int, right: Int, bottom: Int, left: Int): Self

    Permalink

    Set layout margins

    Set layout margins

    Definition Classes
    Figure
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. val numberColumns: Int

    Permalink
  19. val numberRows: Int

    Permalink
  20. val options: FigureOptions

    Permalink
    Definition Classes
    GridFigureFigure
  21. def paperBackgroundColor(r: Int, g: Int, b: Int): Self

    Permalink

    Set the paper's background color.

    Set the paper's background color.

    Definition Classes
    Figure
  22. def paperBackgroundColor(r: Int, g: Int, b: Int, a: Double): Self

    Permalink

    Set the paper's background color with (red, green, blue, alpha)

    Set the paper's background color with (red, green, blue, alpha)

    Definition Classes
    Figure
  23. def paperBackgroundColor(newColor: Color): Self

    Permalink

    Set the paper's background color

    Set the paper's background color

    val figure = Figure().paperBackgroundColor(Color.rgb(0, 255, 0))
    Definition Classes
    Figure
  24. def plot(rowIndex: Int, columnIndex: Int)(newPlot: Plot): GridFigure

    Permalink

    Set the content of a sub-plot.

    Set the content of a sub-plot.

    This returns a copy of the current figure with the new plot.

  25. def plotAt(rowIndex: Int, columnIndex: Int): Plot

    Permalink

    Get the plot at a specific row, column.

  26. def plotBackgroundColor(r: Int, g: Int, b: Int): Self

    Permalink

    Set the plot's background color

    Set the plot's background color

    Definition Classes
    Figure
  27. def plotBackgroundColor(r: Int, g: Int, b: Int, a: Double): Self

    Permalink

    Set the plot's background color with (red, green, blue, alpha)

    Set the plot's background color with (red, green, blue, alpha)

    Definition Classes
    Figure
  28. def plotBackgroundColor(newColor: Color): Self

    Permalink

    Set the plot's background color

    Set the plot's background color

    val figure = Figure().plotBackgroundColor(Color.rgb(0, 255, 0))
    Definition Classes
    Figure
  29. val plots: Vector[Plot]

    Permalink
    Definition Classes
    GridFigureFigure
  30. def rightMargin(newRightMargin: Int): Self

    Permalink

    Set right margin (in px)

    Set right margin (in px)

    Definition Classes
    Figure
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def title(newTitle: String): Self

    Permalink

    Set figure title

    Set figure title

    Definition Classes
    Figure
  33. def topMargin(newTopMargin: Int): Self

    Permalink

    Set top margin (in px)

    Set top margin (in px)

    Definition Classes
    Figure
  34. def viewPortAt(rowIndex: Int, columnIndex: Int): ViewPort

    Permalink

    Get the view-port at a specific row, column.

  35. val viewPorts: Vector[ViewPort]

    Permalink
    Definition Classes
    GridFigureFigure
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def width(newWidth: Int): Self

    Permalink

    Set the plot width (in px)

    Set the plot width (in px)

    Definition Classes
    Figure
  40. def withNewOptions(newOptions: FigureOptions): Self

    Permalink
    Definition Classes
    GridFigureFigure

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Figure

Inherited from AnyRef

Inherited from Any

Ungrouped