Fix some deprecations
This commit is contained in:
parent
f097fb57b5
commit
3a2ee0fc72
2
REQUIRE
2
REQUIRE
@ -1,4 +1,4 @@
|
|||||||
julia 0.6
|
julia 0.6-pre
|
||||||
|
|
||||||
RecipesBase
|
RecipesBase
|
||||||
PlotUtils 0.4.1
|
PlotUtils 0.4.1
|
||||||
|
|||||||
11
src/Plots.jl
11
src/Plots.jl
@ -1,4 +1,4 @@
|
|||||||
__precompile__(true)
|
__precompile__(false)
|
||||||
|
|
||||||
module Plots
|
module Plots
|
||||||
|
|
||||||
@ -118,6 +118,15 @@ ignoreNaN_extrema(x) = Base.extrema(x)
|
|||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
|
# to cater for block matrices, Base.transpose is recursive.
|
||||||
|
# This makes it impossible to create row vectors of String and Symbol with the transpose operator.
|
||||||
|
# This solves this issue, internally in Plots at least.
|
||||||
|
|
||||||
|
Base.transpose(x::Symbol) = x
|
||||||
|
Base.transpose(x::String) = x
|
||||||
|
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
import Measures
|
import Measures
|
||||||
import Measures: Length, AbsoluteLength, Measure, BoundingBox, mm, cm, inch, pt, width, height, w, h
|
import Measures: Length, AbsoluteLength, Measure, BoundingBox, mm, cm, inch, pt, width, height, w, h
|
||||||
const BBox = Measures.Absolute2DBox
|
const BBox = Measures.Absolute2DBox
|
||||||
|
|||||||
@ -41,7 +41,7 @@ PlotExample("Colors",
|
|||||||
[:(begin
|
[:(begin
|
||||||
y = rand(100)
|
y = rand(100)
|
||||||
plot(0:10:100,rand(11,4),lab="lines",w=3,palette=:grays,fill=0, α=0.6)
|
plot(0:10:100,rand(11,4),lab="lines",w=3,palette=:grays,fill=0, α=0.6)
|
||||||
scatter!(y, zcolor=abs(y-.5), m=(:heat,0.8,stroke(1,:green)), ms=10*abs(y-0.5)+4, lab="grad")
|
scatter!(y, zcolor=abs.(y-.5), m=(:heat,0.8,stroke(1,:green)), ms=10*abs.(y-0.5)+4, lab="grad")
|
||||||
end)]
|
end)]
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ PlotExample("Polar Plots",
|
|||||||
"",
|
"",
|
||||||
[:(begin
|
[:(begin
|
||||||
Θ = linspace(0,1.5π,100)
|
Θ = linspace(0,1.5π,100)
|
||||||
r = abs(0.1randn(100)+sin(3Θ))
|
r = abs.(0.1randn(100)+sin.(3Θ))
|
||||||
plot(Θ, r, proj=:polar, m=2)
|
plot(Θ, r, proj=:polar, m=2)
|
||||||
end)]
|
end)]
|
||||||
),
|
),
|
||||||
|
|||||||
@ -60,7 +60,7 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...)
|
|||||||
|
|
||||||
# build our plot vector from the args
|
# build our plot vector from the args
|
||||||
n = length(plts_tail) + 1
|
n = length(plts_tail) + 1
|
||||||
plts = Array(Plot, n)
|
plts = Array{Plot}(n)
|
||||||
plts[1] = plt1
|
plts[1] = plt1
|
||||||
for (i,plt) in enumerate(plts_tail)
|
for (i,plt) in enumerate(plts_tail)
|
||||||
plts[i+1] = plt
|
plts[i+1] = plt
|
||||||
|
|||||||
@ -669,7 +669,7 @@ end
|
|||||||
edge_x, edge_y, weights = x, y, z.surf
|
edge_x, edge_y, weights = x, y, z.surf
|
||||||
|
|
||||||
float_weights = float(weights)
|
float_weights = float(weights)
|
||||||
if is(float_weights, weights)
|
if float_weights === weights
|
||||||
float_weights = deepcopy(float_weights)
|
float_weights = deepcopy(float_weights)
|
||||||
end
|
end
|
||||||
for (i, c) in enumerate(float_weights)
|
for (i, c) in enumerate(float_weights)
|
||||||
|
|||||||
@ -355,8 +355,8 @@ function convert_to_polar(x, y, r_extrema = calc_r_extrema(x, y))
|
|||||||
x = zeros(n)
|
x = zeros(n)
|
||||||
y = zeros(n)
|
y = zeros(n)
|
||||||
for i in 1:n
|
for i in 1:n
|
||||||
x[i] = cycle(r,i) * cos(cycle(phi,i))
|
x[i] = cycle(r,i) * cos.(cycle(phi,i))
|
||||||
y[i] = cycle(r,i) * sin(cycle(phi,i))
|
y[i] = cycle(r,i) * sin.(cycle(phi,i))
|
||||||
end
|
end
|
||||||
x, y
|
x, y
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user