series

series(curves)

Curves can be:

  • AbstractVector{<: AbstractVector{<: Point2}}: the native representation of a series as a vector of lines

  • AbstractMatrix: each row represents y coordinates of the line, while x goes from 1:size(curves, 1)

  • AbstractVector, AbstractMatrix: the same as the above, but the first argument sets the x values for all lines

  • AbstractVector{<: Tuple{X<: AbstractVector, Y<: AbstractVector}}: A vector of tuples, where each tuple contains a vector for the x and y coordinates

If any of marker, markersize, markercolor, strokecolor or strokewidth is set != nothing, a scatterplot is added.

Plot type

The plot type alias for the series function is Series.

Attributes

color = :lighttestNo docs available.

joinstyle = @inherit joinstyleNo docs available.

labels = nothingNo docs available.

linecap = @inherit linecapNo docs available.

linestyle = :solidNo docs available.

linewidth = 2No docs available.

marker = nothingNo docs available.

markercolor = automaticNo docs available.

markersize = nothingNo docs available.

miter_limit = @inherit miter_limitNo docs available.

solid_color = nothingNo docs available.

space = :dataNo docs available.

strokecolor = nothingNo docs available.

strokewidth = nothingNo docs available.

Examples

Matrix

using CairoMakie


data = cumsum(randn(4, 101), dims = 2)

fig, ax, sp = series(data, labels=["label $i" for i in 1:4])
axislegend(ax)
fig

Vector of vectors

pointvectors = [Point2f.(1:100, cumsum(randn(100))) for i in 1:4]

series(pointvectors, markersize=5, color=:Set1)

Vector and matrix

data = cumsum(randn(4, 101), dims = 2)

series(0:0.1:10, data, solid_color=:black)