ensure non-identical clims for gr
This commit is contained in:
parent
e95b2a2a8f
commit
d3343c43a1
@ -856,6 +856,20 @@ function get_z_normalized(z, clims...)
|
|||||||
return remap(clamp(z, clims...), clims...)
|
return remap(clamp(z, clims...), clims...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function gr_clims(args...)
|
||||||
|
lo, hi = get_clims(args...)
|
||||||
|
if lo == hi
|
||||||
|
if lo == 0
|
||||||
|
hi = 1.0
|
||||||
|
elseif lo < 0
|
||||||
|
hi = 0.0
|
||||||
|
else
|
||||||
|
lo = 0.0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return lo, hi
|
||||||
|
end
|
||||||
|
|
||||||
function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||||
_update_min_padding!(sp)
|
_update_min_padding!(sp)
|
||||||
|
|
||||||
@ -893,7 +907,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# draw the colorbar
|
# draw the colorbar
|
||||||
hascolorbar(sp) && gr_draw_colorbar(cbar, sp, get_clims(sp), viewport_plotarea)
|
hascolorbar(sp) && gr_draw_colorbar(cbar, sp, gr_clims(sp), viewport_plotarea)
|
||||||
|
|
||||||
# add the legend
|
# add the legend
|
||||||
gr_add_legend(sp, leg, viewport_plotarea)
|
gr_add_legend(sp, leg, viewport_plotarea)
|
||||||
@ -942,7 +956,7 @@ function gr_add_legend(sp, leg, viewport_plotarea)
|
|||||||
gr_set_font(legendfont(sp), sp)
|
gr_set_font(legendfont(sp), sp)
|
||||||
end
|
end
|
||||||
for series in series_list(sp)
|
for series in series_list(sp)
|
||||||
clims = get_clims(sp, series)
|
clims = gr_clims(sp, series)
|
||||||
should_add_to_legend(series) || continue
|
should_add_to_legend(series) || continue
|
||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
lc = get_linecolor(series, clims)
|
lc = get_linecolor(series, clims)
|
||||||
@ -1502,7 +1516,7 @@ function gr_add_series(sp, series)
|
|||||||
x, y = convert_to_polar(x, y, (rmin, rmax))
|
x, y = convert_to_polar(x, y, (rmin, rmax))
|
||||||
end
|
end
|
||||||
|
|
||||||
clims = get_clims(sp, series)
|
clims = gr_clims(sp, series)
|
||||||
|
|
||||||
# add custom frame shapes to markershape?
|
# add custom frame shapes to markershape?
|
||||||
series_annotations_shapes!(series)
|
series_annotations_shapes!(series)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user