6.2 Attributes

A custom plot can be created by using attributes. The attributes can be set through keyword arguments. A list of attributes for a plot object, pltobj, can be viewed via pltobj.attributes as in:

fig, ax, pltobj = scatterlines(1:10)
pltobj.attributes
Attributes with 16 entries:
  color => RGBA{Float32}(0.0,0.447059,0.698039,1.0)
  colormap => viridis
  colorrange => Automatic()
  colorscale => identity
  cycle => [:color]
  inspectable => true
  linestyle => nothing
  linewidth => 1.5
  marker => circle
  markercolor => Automatic()
  markercolormap => Automatic()
  markercolorrange => Automatic()
  markersize => 9
  model => Float32[1.0 0.0 0.0 0.0; 0.0 1.0 0.0 0.0; 0.0 0.0 1.0 0.0; 0.0 0.0 0.0 1.0]
  strokecolor => black
  strokewidth => 0

Asking for help in the REPL as ?ablines or help(ablines) for any given plotting function will show you their corresponding attributes plus a short description on how to use that specific function. For example, for ablines:

help(ablines)
  ablines(intercepts, slopes; attrs...)

  Creates a line defined by f(x) = slope * x + intercept crossing a whole
  Scene with 2D projection at its current limits. You can pass one or multiple
  intercepts or slopes.

  All style attributes are the same as for LineSegments.

  ablines has the following function signatures:

    (Vector, Vector)
    (Vector, Vector, Vector)
    (Matrix)

  Available attributes for Plot{Makie.ablines} are:

    cycle
    xautolimits
    yautolimits

Not only the plot objects have attributes, in the next Section we will see that also the Axis and Figure objects do.



Support this project
CC BY-NC-SA 4.0 Jose Storopoli, Rik Huijzer, Lazaro Alonso