Unconnected lines using missing or NaN

Source code Author Update time

using Plots
pythonplot()

Missing values and non-finite values, including NaN, are not plotted. Instead, lines are separated into segments at these values.

(x, y) = ([1, 2, 2, 1, 1], [1, 2, 1, 2, 1])
plot(plot([rand(5); NaN; rand(5); NaN; rand(5)]), plot([1, missing, 2, 3], marker = true), plot([x; NaN; x .+ 2], [y; NaN; y .+ 1], arrow = 2), plot([1, 2 + 3im, Inf, 4im, 3, -Inf * im, 0, 3 + 3im], marker = true), legend = false)
2023-08-30T09:53:33.422651 image/svg+xml Matplotlib v3.7.2, https://matplotlib.org/

This page was generated using DemoCards.jl and Literate.jl.