Compare commits

...

3 Commits

Author SHA1 Message Date
Josef Heinen 8951526d0d Set minimum GR version 2019-01-07 13:26:08 +01:00
Michael Krabbe Borregaard 3e799fbe21 Merge pull request #1880 from jheinen/master
Added support for discrete contour plots
2019-01-06 11:30:33 +01:00
Josef Heinen 53e27dbc38 Added support for discrete contour plots 2019-01-06 11:24:45 +01:00
2 changed files with 6 additions and 9 deletions
+1 -1
View File
@@ -13,4 +13,4 @@ JSON
NaNMath
Requires
Contour
GR 0.35.0
GR 0.37.0
+5 -8
View File
@@ -1029,16 +1029,13 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
else
h = series[:levels] > 1 ? range(zmin, stop=zmax, length=series[:levels]) : [(zmin + zmax) / 2]
end
GR.setlinetype(gr_linetype[get_linestyle(series)])
GR.setlinewidth(max(0, get_linewidth(series) / (sum(gr_plot_size) * 0.001)))
if series[:fillrange] != nothing
GR.surface(x, y, z, GR.OPTION_CELL_ARRAY)
GR.contourf(x, y, h, z, series[:contour_labels] == true ? 1 : 0)
else
GR.setlinetype(gr_linetype[get_linestyle(series)])
GR.setlinewidth(max(0, get_linewidth(series) / (sum(gr_plot_size) * 0.001)))
if plot_color(series[:linecolor]) == [plot_color(:black)]
GR.contour(x, y, h, z, 0 + (series[:contour_labels] == true ? 1 : 0))
else
GR.contour(x, y, h, z, 1000 + (series[:contour_labels] == true ? 1 : 0))
end
coff = plot_color(series[:linecolor]) == [plot_color(:black)] ? 0 : 1000
GR.contour(x, y, h, z, coff + (series[:contour_labels] == true ? 1 : 0))
end
# create the colorbar of contour levels