From 3cea2df459f19ca29dd88b4925046449a577d2db Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Thu, 19 May 2016 14:00:39 -0400 Subject: [PATCH] fix get_subplot_index; fix pyplot colorbar --- src/backends/pyplot.jl | 3 ++- src/subplots.jl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index d1327305..7dfcc491 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -575,6 +575,7 @@ pymarkercolormap(d::KW) = getPyPlotColorMap(d[:markercolor], d[:markeralpha] pyfillcolormap(d::KW) = getPyPlotColorMap(d[:fillcolor], d[:fillalpha]) # function _add_series(pkg::PyPlotBackend, plt::Plot, d::KW) +# TODO: change this to accept Subplot?? function _add_series(plt::Plot{PyPlotBackend}, series::Series) d = series.d st = d[:seriestype] @@ -927,7 +928,7 @@ function _add_series(plt::Plot{PyPlotBackend}, series::Series) handleSmooth(plt, ax, d, d[:smooth]) # 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) # do we need a discrete colorbar? diff --git a/src/subplots.jl b/src/subplots.jl index 9b86e28e..ae25236b 100644 --- a/src/subplots.jl +++ b/src/subplots.jl @@ -18,6 +18,6 @@ get_subplot(plt::Plot, k) = plt.spmap[k] get_subplot(series::Series) = series.d[:subplot] 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) # ----------------------------------------------------------------------