replacing String with AbstractString
This commit is contained in:
parent
a9062b0611
commit
4514802e35
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
# -------------------------------
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user