Reputation: 464
I would like to plot the values Emean against T (like shown in the image below).
My guess is that there should be only two lines, since there are only two dataframes.
This means that the "connecting" line that I marked in yellow should not be there. Is there a way to "separate" the plots?
Upvotes: 2
Views: 171
Reputation: 69819
I assume you want to plot two lines as they are defined by grouping variable :L
. If this is correct then you can do the following:
julia> using DataFrames
julia> using Plots
julia> using StatsPlots
julia> df = DataFrame(L=[1,1,1,2,2,2], T=[1,2,3,1,2,3], Emean=[1,2,3,4,5,6])
6×3 DataFrame
Row │ L T Emean
│ Int64 Int64 Int64
─────┼─────────────────────
1 │ 1 1 1
2 │ 1 2 2
3 │ 1 3 3
4 │ 2 1 4
5 │ 2 2 5
6 │ 2 3 6
julia> @df df plot(:T, :Emean, group=:L)
to get what you want.
Here I am using the functionality provided by the StatsPlots.jl package.
Upvotes: 1