Remove all 0.5-compliant uses of the transpose operator (')

A horrible change, but one required by the metadata maintainers.
This commit is contained in:
Michael K. Borregaard 2017-06-11 22:25:15 +02:00
parent 8e6fdfac3c
commit a1df325051
4 changed files with 14 additions and 11 deletions

View File

@ -1,4 +1,4 @@
__precompile__(true) __precompile__(false)
module Plots module Plots
@ -120,8 +120,11 @@ ignorenan_extrema(x) = Base.extrema(x)
# This makes it impossible to create row vectors of String and Symbol with the transpose operator. # 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. # This solves this issue, internally in Plots at least.
Base.transpose(x::Symbol) = x
Base.transpose(x::String) = x # commented out on the insistence of the METADATA maintainers
#Base.transpose(x::Symbol) = x
#Base.transpose(x::String) = x
# --------------------------------------------------------- # ---------------------------------------------------------

View File

@ -130,7 +130,7 @@ PlotExample("Marker types",
markers = reshape(markers, 1, length(markers)) markers = reshape(markers, 1, length(markers))
n = length(markers) n = length(markers)
x = linspace(0,10,n+2)[2:end-1] x = linspace(0,10,n+2)[2:end-1]
y = repmat(reverse(x)', n, 1) y = repmat(reshape(reverse(x),1,:), n, 1)
scatter(x, y, m=(8,:auto), lab=map(string,markers), bg=:linen, xlim=(0,10), ylim=(0,10)) scatter(x, y, m=(8,:auto), lab=map(string,markers), bg=:linen, xlim=(0,10), ylim=(0,10))
end)] end)]
), ),
@ -216,7 +216,7 @@ PlotExample("Contours",
x = 1:0.5:20 x = 1:0.5:20
y = 1:0.5:10 y = 1:0.5:10
f(x,y) = (3x+y^2)*abs(sin(x)+cos(y)) f(x,y) = (3x+y^2)*abs(sin(x)+cos(y))
X = repmat(x', length(y), 1) X = repmat(reshape(x,1,:), length(y), 1)
Y = repmat(y, 1, length(x)) Y = repmat(y, 1, length(x))
Z = map(f, X, Y) Z = map(f, X, Y)
p1 = contour(x, y, f, fill=true) p1 = contour(x, y, f, fill=true)
@ -280,7 +280,7 @@ PlotExample("Heatmap, categorical axes, and aspect_ratio",
[:(begin [:(begin
xs = [string("x",i) for i=1:10] xs = [string("x",i) for i=1:10]
ys = [string("y",i) for i=1:4] ys = [string("y",i) for i=1:4]
z = float((1:4)*(1:10)') z = float((1:4)*reshape(1:10,1,:))
heatmap(xs, ys, z, aspect_ratio=1) heatmap(xs, ys, z, aspect_ratio=1)
end)] end)]
), ),

View File

@ -870,7 +870,7 @@ end
# get the joined vector # get the joined vector
function get_xy(v::AVec{OHLC}, x = 1:length(v)) function get_xy(v::AVec{OHLC}, x = 1:length(v))
xdiff = 0.3ignorenan_mean(abs(diff(x))) xdiff = 0.3ignorenan_mean(abs.(diff(x)))
x_out, y_out = zeros(0), zeros(0) x_out, y_out = zeros(0), zeros(0)
for (i,ohlc) in enumerate(v) for (i,ohlc) in enumerate(v)
ox,oy = get_xy(ohlc, x[i], xdiff) ox,oy = get_xy(ohlc, x[i], xdiff)
@ -911,7 +911,7 @@ end
# "Sparsity plot... heatmap of non-zero values of a matrix" # "Sparsity plot... heatmap of non-zero values of a matrix"
# function spy{T<:Real}(z::AMat{T}; kw...) # function spy{T<:Real}(z::AMat{T}; kw...)
# mat = map(zi->float(zi!=0), z)' # mat = reshape(map(zi->float(zi!=0), z),1,:)
# xn, yn = size(mat) # xn, yn = size(mat)
# heatmap(mat; leg=false, yflip=true, aspect_ratio=:equal, # heatmap(mat; leg=false, yflip=true, aspect_ratio=:equal,
# xlim=(0.5, xn+0.5), ylim=(0.5, yn+0.5), # xlim=(0.5, xn+0.5), ylim=(0.5, yn+0.5),
@ -1005,7 +1005,7 @@ end
end end
library = PlotUtils.color_libraries[cl.args[1]] library = PlotUtils.color_libraries[cl.args[1]]
z = sqrt.((1:15)*(1:20)') z = sqrt.((1:15)*reshape(1:20,1,:))
seriestype := :heatmap seriestype := :heatmap
ticks := nothing ticks := nothing
@ -1029,7 +1029,7 @@ end
if !(length(grad.args) == 1 && isa(grad.args[1], Symbol)) if !(length(grad.args) == 1 && isa(grad.args[1], Symbol))
error("showgradient takes the name of a color gradient as a Symbol") error("showgradient takes the name of a color gradient as a Symbol")
end end
z = sqrt.((1:15)*(1:20)') z = sqrt.((1:15)*reshape(1:20,1,:))
seriestype := :heatmap seriestype := :heatmap
ticks := nothing ticks := nothing
legend := false legend := false

View File

@ -324,7 +324,7 @@ function replaceAliases!(d::KW, aliases::Dict{Symbol,Symbol})
end end
end end
createSegments(z) = collect(repmat(z',2,1))[2:end] createSegments(z) = collect(repmat(reshape(z,1,:),2,1))[2:end]
Base.first(c::Colorant) = c Base.first(c::Colorant) = c
Base.first(x::Symbol) = x Base.first(x::Symbol) = x