Skip to content

Commit 3a2ee0f

Browse files
committed
Fix some deprecations
1 parent f097fb5 commit 3a2ee0f

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.6
1+
julia 0.6-pre
22

33
RecipesBase
44
PlotUtils 0.4.1

src/Plots.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__precompile__(true)
1+
__precompile__(false)
22

33
module Plots
44

@@ -118,6 +118,15 @@ ignoreNaN_extrema(x) = Base.extrema(x)
118118

119119
# ---------------------------------------------------------
120120

121+
# to cater for block matrices, Base.transpose is recursive.
122+
# This makes it impossible to create row vectors of String and Symbol with the transpose operator.
123+
# This solves this issue, internally in Plots at least.
124+
125+
Base.transpose(x::Symbol) = x
126+
Base.transpose(x::String) = x
127+
128+
# ---------------------------------------------------------
129+
121130
import Measures
122131
import Measures: Length, AbsoluteLength, Measure, BoundingBox, mm, cm, inch, pt, width, height, w, h
123132
const BBox = Measures.Absolute2DBox

src/examples.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PlotExample("Colors",
4141
[:(begin
4242
y = rand(100)
4343
plot(0:10:100,rand(11,4),lab="lines",w=3,palette=:grays,fill=0, α=0.6)
44-
scatter!(y, zcolor=abs(y-.5), m=(:heat,0.8,stroke(1,:green)), ms=10*abs(y-0.5)+4, lab="grad")
44+
scatter!(y, zcolor=abs.(y-.5), m=(:heat,0.8,stroke(1,:green)), ms=10*abs.(y-0.5)+4, lab="grad")
4545
end)]
4646
),
4747

@@ -269,7 +269,7 @@ PlotExample("Polar Plots",
269269
"",
270270
[:(begin
271271
Θ = linspace(0,1.5π,100)
272-
r = abs(0.1randn(100)+sin(3Θ))
272+
r = abs.(0.1randn(100)+sin.(3Θ))
273273
plot(Θ, r, proj=:polar, m=2)
274274
end)]
275275
),

src/plot.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...)
6060

6161
# build our plot vector from the args
6262
n = length(plts_tail) + 1
63-
plts = Array(Plot, n)
63+
plts = Array{Plot}(n)
6464
plts[1] = plt1
6565
for (i,plt) in enumerate(plts_tail)
6666
plts[i+1] = plt

src/recipes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ end
669669
edge_x, edge_y, weights = x, y, z.surf
670670

671671
float_weights = float(weights)
672-
if is(float_weights, weights)
672+
if float_weights === weights
673673
float_weights = deepcopy(float_weights)
674674
end
675675
for (i, c) in enumerate(float_weights)

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ function convert_to_polar(x, y, r_extrema = calc_r_extrema(x, y))
355355
x = zeros(n)
356356
y = zeros(n)
357357
for i in 1:n
358-
x[i] = cycle(r,i) * cos(cycle(phi,i))
359-
y[i] = cycle(r,i) * sin(cycle(phi,i))
358+
x[i] = cycle(r,i) * cos.(cycle(phi,i))
359+
y[i] = cycle(r,i) * sin.(cycle(phi,i))
360360
end
361361
x, y
362362
end

0 commit comments

Comments
 (0)