Fix some deprecations
This commit is contained in:
parent
f097fb57b5
commit
3a2ee0fc72
11
src/Plots.jl
11
src/Plots.jl
@ -1,4 +1,4 @@
|
||||
__precompile__(true)
|
||||
__precompile__(false)
|
||||
|
||||
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: Length, AbsoluteLength, Measure, BoundingBox, mm, cm, inch, pt, width, height, w, h
|
||||
const BBox = Measures.Absolute2DBox
|
||||
|
||||
@ -41,7 +41,7 @@ PlotExample("Colors",
|
||||
[:(begin
|
||||
y = rand(100)
|
||||
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)]
|
||||
),
|
||||
|
||||
@ -269,7 +269,7 @@ PlotExample("Polar Plots",
|
||||
"",
|
||||
[:(begin
|
||||
Θ = 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)
|
||||
end)]
|
||||
),
|
||||
|
||||
@ -60,7 +60,7 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...)
|
||||
|
||||
# build our plot vector from the args
|
||||
n = length(plts_tail) + 1
|
||||
plts = Array(Plot, n)
|
||||
plts = Array{Plot}(n)
|
||||
plts[1] = plt1
|
||||
for (i,plt) in enumerate(plts_tail)
|
||||
plts[i+1] = plt
|
||||
|
||||
@ -669,7 +669,7 @@ end
|
||||
edge_x, edge_y, weights = x, y, z.surf
|
||||
|
||||
float_weights = float(weights)
|
||||
if is(float_weights, weights)
|
||||
if float_weights === weights
|
||||
float_weights = deepcopy(float_weights)
|
||||
end
|
||||
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)
|
||||
y = zeros(n)
|
||||
for i in 1:n
|
||||
x[i] = cycle(r,i) * cos(cycle(phi,i))
|
||||
y[i] = cycle(r,i) * sin(cycle(phi,i))
|
||||
x[i] = cycle(r,i) * cos.(cycle(phi,i))
|
||||
y[i] = cycle(r,i) * sin.(cycle(phi,i))
|
||||
end
|
||||
x, y
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user