replacing String with AbstractString

This commit is contained in:
Thomas Breloff 2015-09-17 21:32:27 -04:00
parent a9062b0611
commit 4514802e35
10 changed files with 12 additions and 12 deletions

View File

@ -11,8 +11,8 @@ doc"""
Holds all data needed for a documentation example... header, description, and plotting expression (Expr)
"""
type PlotExample
header::String
desc::String
header::AbstractString
desc::AbstractString
exprs::Vector{Expr}
end

View File

@ -87,7 +87,7 @@ ohlc!(args...; kw...) = plot!(args...; kw..., linetype = :ohlc)
savepng(args...; kw...) = savepng(currentPlot(), args...; kw...)
savepng(plt::PlottingObject, args...; kw...) = savepng(plt.plotter, plt, args...; kw...)
savepng(::PlottingPackage, plt::PlottingObject, fn::String, args...) = error("unsupported") # fallback so multiple dispatch doesn't get confused if it's missing
savepng(::PlottingPackage, plt::PlottingObject, fn::AbstractString, args...) = error("unsupported") # fallback so multiple dispatch doesn't get confused if it's missing
# ---------------------------------------------------------

View File

@ -111,7 +111,7 @@ function getRGBColor(c, n::Int = 0)
if isa(c, Symbol)
c = string(c)
end
if isa(c, String)
if isa(c, AbstractString)
c = parse(Colorant, c)
end

View File

@ -182,7 +182,7 @@ end
# -------------------------------
function savepng(::GadflyPackage, plt::PlottingObject, fn::String;
function savepng(::GadflyPackage, plt::PlottingObject, fn::AbstractString;
w = 6 * Gadfly.inch,
h = 4 * Gadfly.inch)
o = getGadflyContext(plt.plotter, plt)

View File

@ -63,7 +63,7 @@ end
getGadflyContext(::ImmersePackage, plt::Plot) = plt.o[2]
getGadflyContext(::ImmersePackage, subplt::Subplot) = buildGadflySubplotContext(subplt)
function savepng(::ImmersePackage, plt::PlottingObject, fn::String;
function savepng(::ImmersePackage, plt::PlottingObject, fn::AbstractString;
w = 6 * Immerse.inch,
h = 4 * Immerse.inch)
gctx = getGadflyContext(plt.plotter, plt)

View File

@ -47,7 +47,7 @@ function getPyPlotMarker(marker::Symbol)
end
# pass through
function getPyPlotMarker(marker::String)
function getPyPlotMarker(marker::AbstractString)
@assert length(marker) == 1
marker
end
@ -226,7 +226,7 @@ end
# -------------------------------
function savepng(::PyPlotPackage, plt::PlottingObject, fn::String, args...)
function savepng(::PyPlotPackage, plt::PlottingObject, fn::AbstractString, args...)
addPyPlotLegend(plt)
f = open(fn, "w")
writemime(f, "image/png", plt.o)

View File

@ -50,7 +50,7 @@ end
# -------------------------------
savepng(::QwtPackage, plt::PlottingObject, fn::String, args...) = Qwt.savepng(plt.o, fn)
savepng(::QwtPackage, plt::PlottingObject, fn::AbstractString, args...) = Qwt.savepng(plt.o, fn)
# -------------------------------

View File

@ -41,7 +41,7 @@ end
# -------------------------------
function savepng(::[PkgName]Package, plt::PlottingObject, fn::String; kw...)
function savepng(::[PkgName]Package, plt::PlottingObject, fn::AbstractString; kw...)
# TODO: save a PNG of the underlying plot/subplot object
end

View File

@ -124,7 +124,7 @@ end
# -------------------------------
function savepng(::UnicodePlotsPackage, plt::PlottingObject, fn::String, args...)
function savepng(::UnicodePlotsPackage, plt::PlottingObject, fn::AbstractString, args...)
# make some whitespace and show the plot
println("\n\n\n\n\n\n")

View File

@ -242,7 +242,7 @@ end
# -------------------------------
function savepng(::WinstonPackage, plt::PlottingObject, fn::String; kw...)
function savepng(::WinstonPackage, plt::PlottingObject, fn::AbstractString; kw...)
f = open(fn, "w")
window, canvas, wplt = getWinstonItems(plt)
addWinstonLegend(plt, wplt)