fix get_subplot_index; fix pyplot colorbar

This commit is contained in:
Thomas Breloff 2016-05-19 14:00:39 -04:00
parent 1cf514d1e6
commit 3cea2df459
2 changed files with 3 additions and 2 deletions

View File

@ -575,6 +575,7 @@ pymarkercolormap(d::KW) = getPyPlotColorMap(d[:markercolor], d[:markeralpha]
pyfillcolormap(d::KW) = getPyPlotColorMap(d[:fillcolor], d[:fillalpha]) pyfillcolormap(d::KW) = getPyPlotColorMap(d[:fillcolor], d[:fillalpha])
# function _add_series(pkg::PyPlotBackend, plt::Plot, d::KW) # function _add_series(pkg::PyPlotBackend, plt::Plot, d::KW)
# TODO: change this to accept Subplot??
function _add_series(plt::Plot{PyPlotBackend}, series::Series) function _add_series(plt::Plot{PyPlotBackend}, series::Series)
d = series.d d = series.d
st = d[:seriestype] st = d[:seriestype]
@ -927,7 +928,7 @@ function _add_series(plt::Plot{PyPlotBackend}, series::Series)
handleSmooth(plt, ax, d, d[:smooth]) handleSmooth(plt, ax, d, d[:smooth])
# add the colorbar legend # add the colorbar legend
if needs_colorbar && plt.plotargs[:colorbar] != :none if needs_colorbar && attr(d[:subplot], :colorbar) != :none
# cbar = PyPlot.colorbar(handles[end], ax=ax) # cbar = PyPlot.colorbar(handles[end], ax=ax)
# do we need a discrete colorbar? # do we need a discrete colorbar?

View File

@ -18,6 +18,6 @@ get_subplot(plt::Plot, k) = plt.spmap[k]
get_subplot(series::Series) = series.d[:subplot] get_subplot(series::Series) = series.d[:subplot]
get_subplot_index(plt::Plot, idx::Integer) = idx get_subplot_index(plt::Plot, idx::Integer) = idx
get_subplot_index(plt::Plot, sp::Subplot) = findfirst(sp->sp === plt.subplots[2], plt.subplots) get_subplot_index(plt::Plot, sp::Subplot) = findfirst(_ -> _ === sp, plt.subplots)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------