Added support for discrete contour plots
This commit is contained in:
parent
9985d303ce
commit
53e27dbc38
2
REQUIRE
2
REQUIRE
@ -13,4 +13,4 @@ JSON
|
|||||||
NaNMath
|
NaNMath
|
||||||
Requires
|
Requires
|
||||||
Contour
|
Contour
|
||||||
GR 0.35.0
|
GR 0.36.0
|
||||||
|
|||||||
@ -1029,16 +1029,13 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
else
|
else
|
||||||
h = series[:levels] > 1 ? range(zmin, stop=zmax, length=series[:levels]) : [(zmin + zmax) / 2]
|
h = series[:levels] > 1 ? range(zmin, stop=zmax, length=series[:levels]) : [(zmin + zmax) / 2]
|
||||||
end
|
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
|
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
|
else
|
||||||
GR.setlinetype(gr_linetype[get_linestyle(series)])
|
coff = plot_color(series[:linecolor]) == [plot_color(:black)] ? 0 : 1000
|
||||||
GR.setlinewidth(max(0, get_linewidth(series) / (sum(gr_plot_size) * 0.001)))
|
GR.contour(x, y, h, z, coff + (series[:contour_labels] == true ? 1 : 0))
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# create the colorbar of contour levels
|
# create the colorbar of contour levels
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user