bar_width and bar_edges keywords; small fixes
This commit is contained in:
parent
3cea2df459
commit
fb60c244f6
@ -146,6 +146,8 @@ _series_defaults[:marker_z] = nothing # value for color scale
|
|||||||
_series_defaults[:levels] = 15
|
_series_defaults[:levels] = 15
|
||||||
_series_defaults[:orientation] = :vertical
|
_series_defaults[:orientation] = :vertical
|
||||||
_series_defaults[:bar_position] = :overlay # for bar plots and histograms: could also be stack (stack up) or dodge (side by side)
|
_series_defaults[:bar_position] = :overlay # for bar plots and histograms: could also be stack (stack up) or dodge (side by side)
|
||||||
|
_series_defaults[:bar_width] = 0.8
|
||||||
|
_series_defaults[:bar_edges] = false
|
||||||
_series_defaults[:xerror] = nothing
|
_series_defaults[:xerror] = nothing
|
||||||
_series_defaults[:yerror] = nothing
|
_series_defaults[:yerror] = nothing
|
||||||
_series_defaults[:ribbon] = nothing
|
_series_defaults[:ribbon] = nothing
|
||||||
|
|||||||
@ -16,7 +16,7 @@ supportedArgs(::PyPlotBackend) = [
|
|||||||
:markershape, :markercolor, :markersize, :markeralpha,
|
:markershape, :markercolor, :markersize, :markeralpha,
|
||||||
:markerstrokewidth, :markerstrokecolor, :markerstrokealpha,
|
:markerstrokewidth, :markerstrokecolor, :markerstrokealpha,
|
||||||
:fillrange, :fillcolor, :fillalpha,
|
:fillrange, :fillcolor, :fillalpha,
|
||||||
:bins,
|
:bins, :bar_width, :bar_edges,
|
||||||
:n, :nc, :nr, :layout,
|
:n, :nc, :nr, :layout,
|
||||||
:smooth,
|
:smooth,
|
||||||
:title, :windowtitle, :show, :size,
|
:title, :windowtitle, :show, :size,
|
||||||
@ -94,6 +94,7 @@ end
|
|||||||
getPyPlotColor(c::Colorant, α=nothing) = map(f->float(f(convertColor(c,α))), (red, green, blue, alpha))
|
getPyPlotColor(c::Colorant, α=nothing) = map(f->float(f(convertColor(c,α))), (red, green, blue, alpha))
|
||||||
getPyPlotColor(cvec::ColorVector, α=nothing) = map(getPyPlotColor, convertColor(cvec, α).v)
|
getPyPlotColor(cvec::ColorVector, α=nothing) = map(getPyPlotColor, convertColor(cvec, α).v)
|
||||||
getPyPlotColor(scheme::ColorScheme, α=nothing) = getPyPlotColor(convertColor(getColor(scheme), α))
|
getPyPlotColor(scheme::ColorScheme, α=nothing) = getPyPlotColor(convertColor(getColor(scheme), α))
|
||||||
|
getPyPlotColor(vec::AVec, α=nothing) = map(c->getPyPlotColor(c,α), vec)
|
||||||
getPyPlotColor(c, α=nothing) = getPyPlotColor(convertColor(c, α))
|
getPyPlotColor(c, α=nothing) = getPyPlotColor(convertColor(c, α))
|
||||||
|
|
||||||
function getPyPlotColorMap(c::ColorGradient, α=nothing)
|
function getPyPlotColorMap(c::ColorGradient, α=nothing)
|
||||||
@ -662,14 +663,14 @@ function _add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if st == :bar
|
if st == :bar
|
||||||
extrakw[isvertical(d) ? :width : :height] = 0.9
|
extrakw[isvertical(d) ? :width : :height] = d[:bar_width]
|
||||||
handle = ax[isvertical(d) ? :bar : :barh](x, y;
|
handle = ax[isvertical(d) ? :bar : :barh](x, y;
|
||||||
label = d[:label],
|
label = d[:label],
|
||||||
zorder = plt.n,
|
zorder = plt.n,
|
||||||
color = pyfillcolor(d),
|
color = pyfillcolor(d),
|
||||||
edgecolor = pylinecolor(d),
|
edgecolor = pylinecolor(d),
|
||||||
linewidth = d[:linewidth],
|
linewidth = d[:linewidth],
|
||||||
align = "center",
|
align = d[:bar_edges] ? "edge" : "center",
|
||||||
extrakw...
|
extrakw...
|
||||||
)[1]
|
)[1]
|
||||||
push!(handles, handle)
|
push!(handles, handle)
|
||||||
|
|||||||
@ -179,6 +179,7 @@ function _apply_series_recipe(plt::Plot, d::KW)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# add the series!
|
# add the series!
|
||||||
|
warnOnUnsupportedArgs(plt.backend, d)
|
||||||
warnOnUnsupported(plt.backend, d)
|
warnOnUnsupported(plt.backend, d)
|
||||||
series = Series(d)
|
series = Series(d)
|
||||||
push!(plt.series_list, series)
|
push!(plt.series_list, series)
|
||||||
@ -269,7 +270,6 @@ function _plot!(plt::Plot, d::KW, args...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# check that the backend will support the command and add it to the list
|
# check that the backend will support the command and add it to the list
|
||||||
warnOnUnsupportedArgs(plt.backend, kw)
|
|
||||||
warnOnUnsupportedScales(plt.backend, kw)
|
warnOnUnsupportedScales(plt.backend, kw)
|
||||||
push!(kw_list, kw)
|
push!(kw_list, kw)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user