Skip to content

Commit

Permalink
Merge pull request #107 from KristofferC/tp/more-v0.7-deprecation-fixes
Browse files Browse the repository at this point in the history
More deprecation fixes after looking at the docs output.
  • Loading branch information
tpapp authored Jul 15, 2018
2 parents f2fc132 + 36fa421 commit 2f56168
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ MacroTools
Missings
Parameters
Requires 0.5.2
StatsBase 0.24
Crayons
2 changes: 1 addition & 1 deletion docs/src/examples/axislike.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ savefigs("groupplot-multiple", ans) # hide
## Polar axis

```@example pgf
angles = [e/50*360*i for i in 1:500]
angles = [/50*360*i for i in 1:500]
radius = [1/(sqrt(i)) for i in range(1; stop = 10, length = 500)]
PolarAxis(PlotInc(Coordinates(angles, radius)))
savefigs("polar", ans) # hide
Expand Down
1 change: 1 addition & 0 deletions src/PGFPlotsX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using ArgCheck: @argcheck
using DataStructures: OrderedDict
using DocStringExtensions: SIGNATURES, TYPEDEF
using Parameters: @unpack
using StatsBase: midpoints
using Requires: @require
using Unicode: lowercase

Expand Down
11 changes: 4 additions & 7 deletions src/requires.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ function __init__()
end

@require StatsBase="2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" begin
# workaround for https://github.com/JuliaStats/StatsBase.jl/issues/344
const _midpoints = x -> middle.(x[2:end], x[1:(end-1)])

function PGFPlotsX.TableData(h::StatsBase.Histogram{T, 1};
kwargs...) where T
PGFPlotsX.TableData(hcat(h.edges[1], vcat(h.weights, 0)),
Expand All @@ -74,14 +71,14 @@ function __init__()

function PGFPlotsX.TableData(histogram::StatsBase.Histogram{T, 2};
kwargs...) where T
PGFPlotsX.TableData(_midpoints(histogram.edges[1]),
_midpoints(histogram.edges[2]),
PGFPlotsX.TableData(midpoints(histogram.edges[1]),
midpoints(histogram.edges[2]),
histogram.weights; kwargs...)
end

function PGFPlotsX.Coordinates(histogram::StatsBase.Histogram{T, 2}) where T
PGFPlotsX.Coordinates(_midpoints(histogram.edges[1]),
_midpoints(histogram.edges[2]),
PGFPlotsX.Coordinates(midpoints(histogram.edges[1]),
midpoints(histogram.edges[2]),
histogram.weights)
end
end
Expand Down

0 comments on commit 2f56168

Please sign in to comment.