Plot every columns of a DataFrame

Ju_ska
Tue, 30 Dec 2025 16:59:06 +0000
General Usage

Hi,

I would like to stack plots on top of each other without having to manage columns.
Like separating the x axis from every other columns, then plot.

using DataFrames
using Plots

df = DataFrame(x = [1,2,3,4], y1 = [8,9,9,8], y2=[3,5,3,3])

Without success, I tried things like:

extract = df[:, filter(x -> x != ["x" ], names(df))]
plot(df.x, eachcol(extract), layout = (2, 1))

6 posts - 4 participants