The starting look of the plots you make: tweaks that every plot constructor (Plot.barcode, Plot.diagram, ...) applies to what it builds, before anything you add yourself, so that Plot.barcode(d) is already in your house style and a tweak added afterwards, or a palette named in the call, wins.
A Look is a Scala given, found by the constructors without an import. Put one where the plots are made, such as at the top of a file or a block:
given Look = Look.print + Text(TextRole.Title, size = 18)
Plot.barcode(d).save("barcode.svg") // in the print look
A look is made of the same tweaks as a plot (Palette, Style, Text, Lines, Numbers, ...). A tweak that a kind of plot cannot have is left out for it, so one look serves figures and 3-D scenes alike (the tick labels of a look do nothing to a scene). With no given Look the constructors use Look.none, and a plot is as it was.
The nearest given Look is used whole. To add to the look in scope, ask for it in an inner scope (a block, a method, or a file that imports a shared look): given Look = summon[Look] + Text(TextRole.Title, size = 21).
Attributes
- Companion
- object
- Experimental
- true
- Source
- Look.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any