-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DataFrames.jl is loaded dynamically.
Since the package is only needed to implement wrappers around the actual functions, there's no immediate drawback of loading it dynamically; any user will only need the wrappers after loading DataFrames, too. Perfect use case for Requires.jl.
- Loading branch information
1 parent
44ce4ad
commit fe1a2e4
Showing
3 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using DataFrames | ||
|
||
Plots.Linear(df::DataFrame; x::Symbol=:x, y::Symbol=:y, kwargs...) = | ||
Plots.Linear(df[!,x], df[!,y]; kwargs...) | ||
|
||
Plots.Linear3(df::DataFrame; x::Symbol=:x, y::Symbol=:y, z::Symbol=:z, kwargs...) = | ||
Plots.Linear3(df[!,x], df[!,y], df[!,z]; kwargs...) | ||
|
||
Plots.Histogram(df::DataFrame; x::Symbol=:x, kwargs...) = | ||
Plots.Histogram(df[!,x]; kwargs...) | ||
|
||
Plots.Scatter(df::DataFrame; x::Symbol=:x, y::Symbol=:y, kwargs...) = | ||
Plots.Scatter(df[!,x], df[!,y]; kwargs...) | ||
|
||
Plots.Quiver(df::DataFrame; x::Symbol=:x, y::Symbol=:y, u::Symbol=:u, v::Symbol=:v, kwargs...) = | ||
Plots.Quiver(convert(Vector, df[!,x]), convert(Vector, df[!,y]), convert(Vector, df[!,u]), convert(Vector, df[!,v]); kwargs...) | ||
|
||
Plots.Histogram2(df::DataFrame; x::Symbol=:x, y::Symbol=:y, kwargs...) = | ||
Plots.Histogram2(convert(Vector, df[!,x]), convert(Vector, df[!,y]); kwargs...) | ||
|
||
Plots.Histogram2(df::DataFrame, edges_x::AbstractVector{C}, edges_y::AbstractVector{C}; x::Symbol=:x, y::Symbol=:y, kwargs...) where {C<:Real} = | ||
Plots.Histogram2(convert(Vector, df[!,x]), convert(Vector, df[!,y]), edges_x, edges_y; kwargs...) |