Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia plot / statsplot does show default labels instead of column names

My Julia plot does show default labels y1 and y2 instead of column names a and b.

using DataFrames, Plots, Statplots

df_test = DataFrame(a = 0:10, b = 20:30, c = 30:40)
@df df_test plot(:a, [:b, :c])

Julia Plot

Any suggestions how to solve the issue without explicitly naming the labels?

like image 372
Rene Avatar asked Jun 28 '26 16:06

Rene


1 Answers

You need to pass the second argument as a 1-row matrix to get what you want:

@df df_test plot(:a, [:b :c])

(note that between :b and :c there is no comma - only a space)

like image 63
Bogumił Kamiński Avatar answered Jul 01 '26 09:07

Bogumił Kamiński



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!