diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 0c2253fe..9e7fbc7a 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1227,16 +1227,18 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) gr_text(GR.wctondc(xi, yi)..., str) end - # draw the colorbar - if cmap && st != :contour # special colorbar with steps is drawn for contours - gr_set_line(1, :solid, yaxis[:foreground_color_axis]) - gr_set_transparency(1) - gr_colorbar(sp, clims) - end - GR.restorestate() end + # draw the colorbar + GR.savestate() + # special colorbar with steps is drawn for contours + if cmap && any(series[:seriestype] != :contour for series in series_list(sp)) + gr_set_line(1, :solid, yaxis[:foreground_color_axis]) + gr_set_transparency(1) + gr_colorbar(sp, clims) + end + GR.restorestate() # add the legend if sp[:legend] != :none