remove const _gr_plot_size, _gr_point_mult and _gr_thickness_scaling
This commit is contained in:
parent
ba8ca424cf
commit
712ef74b81
@ -228,7 +228,9 @@ function gr_polaraxes(rmin::Real, rmax::Real, sp::Subplot)
|
||||
|
||||
#draw angular grid
|
||||
if xaxis[:grid]
|
||||
gr_set_line(xaxis[:gridlinewidth], xaxis[:gridstyle], xaxis[:foreground_color_grid])
|
||||
gr_set_line(
|
||||
xaxis[:gridlinewidth], xaxis[:gridstyle], xaxis[:foreground_color_grid], sp
|
||||
)
|
||||
gr_set_transparency(xaxis[:foreground_color_grid], xaxis[:gridalpha])
|
||||
for i in eachindex(α)
|
||||
GR.polyline([sinf[i], 0], [cosf[i], 0])
|
||||
@ -237,7 +239,9 @@ function gr_polaraxes(rmin::Real, rmax::Real, sp::Subplot)
|
||||
|
||||
#draw radial grid
|
||||
if yaxis[:grid]
|
||||
gr_set_line(yaxis[:gridlinewidth], yaxis[:gridstyle], yaxis[:foreground_color_grid])
|
||||
gr_set_line(
|
||||
yaxis[:gridlinewidth], yaxis[:gridstyle], yaxis[:foreground_color_grid], sp
|
||||
)
|
||||
gr_set_transparency(yaxis[:foreground_color_grid], yaxis[:gridalpha])
|
||||
for i in eachindex(rtick_values)
|
||||
r = (rtick_values[i] - rmin) / (rmax - rmin)
|
||||
@ -301,7 +305,7 @@ function gr_draw_marker(series, xi, yi, clims, i, msize, strokewidth, shape::Sha
|
||||
sx, sy = coords(shape)
|
||||
# convert to ndc coords (percentages of window)
|
||||
GR.selntran(0)
|
||||
w, h = gr_plot_size
|
||||
w, h = get_size(series)
|
||||
f = msize / (w + h)
|
||||
xi, yi = GR.wctondc(xi, yi)
|
||||
xs = xi .+ sx .* f
|
||||
@ -315,14 +319,14 @@ function gr_draw_marker(series, xi, yi, clims, i, msize, strokewidth, shape::Sha
|
||||
|
||||
# draw the shapes
|
||||
msc = get_markerstrokecolor(series, i)
|
||||
gr_set_line(strokewidth, :solid, msc)
|
||||
gr_set_line(strokewidth, :solid, msc, series)
|
||||
gr_set_transparency(msc, get_markerstrokealpha(series, i))
|
||||
GR.polyline(xs, ys)
|
||||
GR.selntran(1)
|
||||
end
|
||||
|
||||
function nominal_size()
|
||||
w, h = gr_plot_size
|
||||
function nominal_size(s)
|
||||
w, h = get_size(s)
|
||||
min(w, h) / 500
|
||||
end
|
||||
|
||||
@ -333,7 +337,7 @@ function gr_draw_marker(series, xi, yi, clims, i, msize, strokewidth, shape::Sym
|
||||
gr_set_markercolor(get_markercolor(series, clims, i));
|
||||
gr_set_transparency(get_markeralpha(series, i))
|
||||
GR.setmarkertype(gr_markertype(shape))
|
||||
GR.setmarkersize(0.3msize / nominal_size())
|
||||
GR.setmarkersize(0.3msize / nominal_size(series))
|
||||
GR.polymarker([xi], [yi])
|
||||
end
|
||||
|
||||
@ -354,8 +358,8 @@ function gr_draw_markers(
|
||||
shapes = series[:markershape]
|
||||
if shapes != :none
|
||||
for i in eachindex(x)
|
||||
ms = _gr_thickness_scaling[1] * _cycle(msize, i)
|
||||
msw = _gr_thickness_scaling[1] * _cycle(strokewidth, i)
|
||||
ms = get_thickness_scaling(series) * _cycle(msize, i)
|
||||
msw = get_thickness_scaling(series) * _cycle(strokewidth, i)
|
||||
shape = _cycle(shapes, i)
|
||||
gr_draw_marker(series, x[i], y[i], clims, i, ms, msw, shape)
|
||||
end
|
||||
@ -364,11 +368,10 @@ end
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
function gr_set_line(lw, style, c) #, a)
|
||||
function gr_set_line(lw, style, c, s) # s can be Subplot or Series
|
||||
GR.setlinetype(gr_linetype(style))
|
||||
w, h = gr_plot_size
|
||||
GR.setlinewidth(_gr_thickness_scaling[1] * max(0, lw / nominal_size()))
|
||||
gr_set_linecolor(c) #, a)
|
||||
GR.setlinewidth(get_thickness_scaling(s) * max(0, lw / nominal_size(s)))
|
||||
gr_set_linecolor(c)
|
||||
end
|
||||
|
||||
|
||||
@ -378,15 +381,15 @@ function gr_set_fill(c) #, a)
|
||||
GR.setfillintstyle(GR.INTSTYLE_SOLID)
|
||||
end
|
||||
|
||||
# this stores the conversion from a font pointsize to "percentage of window height" (which is what GR uses)
|
||||
const _gr_point_mult = 0.0018 * ones(1)
|
||||
const _gr_thickness_scaling = ones(1)
|
||||
# this stores the conversion from a font pointsize to "percentage of window height"
|
||||
# (which is what GR uses). `s` can be a Series, Subplot or Plot
|
||||
gr_point_mult(s) = 1.5 * get_thickness_scaling(s) * px / pt / maximum(get_size(s))
|
||||
|
||||
# set the font attributes... assumes _gr_point_mult has been populated already
|
||||
function gr_set_font(f::Font; halign = f.halign, valign = f.valign,
|
||||
# set the font attributes.
|
||||
function gr_set_font(f::Font, s; halign = f.halign, valign = f.valign,
|
||||
color = f.color, rotation = f.rotation)
|
||||
family = lowercase(f.family)
|
||||
GR.setcharheight(_gr_point_mult[1] * f.pointsize)
|
||||
GR.setcharheight(gr_point_mult(s) * f.pointsize)
|
||||
GR.setcharup(sind(-rotation), cosd(-rotation))
|
||||
if haskey(gr_font_family, family)
|
||||
GR.settextfontprec(100 + gr_font_family[family], GR.TEXT_PRECISION_STRING)
|
||||
@ -413,10 +416,6 @@ end
|
||||
|
||||
# --------------------------------------------------------------------------------------
|
||||
# viewport plot area
|
||||
|
||||
# the size of the current plot in pixels
|
||||
const gr_plot_size = [600.0, 400.0]
|
||||
|
||||
function gr_viewport_from_bbox(sp::Subplot{GRBackend}, bb::BoundingBox, w, h, viewport_canvas)
|
||||
viewport = zeros(4)
|
||||
viewport[1] = viewport_canvas[2] * (left(bb) / w)
|
||||
@ -541,9 +540,12 @@ function gr_draw_colorbar(cbar::GRColorbar, sp::Subplot, clims, viewport_plotare
|
||||
if !isempty(cbar.lines)
|
||||
series = cbar.lines
|
||||
gr_set_gradient(_cbar_unique(get_colorgradient.(series),"color"))
|
||||
gr_set_line(_cbar_unique(get_linewidth.(series), "line width"),
|
||||
gr_set_line(
|
||||
_cbar_unique(get_linewidth.(series), "line width"),
|
||||
_cbar_unique(get_linestyle.(series), "line style"),
|
||||
_cbar_unique(get_linecolor.(series, Ref(clims)), "line color"))
|
||||
_cbar_unique(get_linecolor.(series, Ref(clims)), "line color"),
|
||||
sp,
|
||||
)
|
||||
gr_set_transparency(_cbar_unique(get_linealpha.(series), "line alpha"))
|
||||
levels = _cbar_unique(contour_levels.(series, Ref(clims)), "levels")
|
||||
colors = gr_colorbar_colors(last(series), clims)
|
||||
@ -554,10 +556,10 @@ function gr_draw_colorbar(cbar::GRColorbar, sp::Subplot, clims, viewport_plotare
|
||||
end
|
||||
|
||||
ztick = 0.5 * GR.tick(zmin, zmax)
|
||||
gr_set_line(1, :solid, plot_color(:black))
|
||||
gr_set_line(1, :solid, plot_color(:black), sp)
|
||||
GR.axes(0, ztick, xmax, zmin, 0, 1, 0.005)
|
||||
|
||||
gr_set_font(guidefont(sp[:yaxis]))
|
||||
gr_set_font(guidefont(sp[:yaxis]), sp)
|
||||
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_TOP)
|
||||
GR.setcharup(-1, 0)
|
||||
gr_text(
|
||||
@ -642,7 +644,6 @@ end
|
||||
function gr_display(plt::Plot, fmt="")
|
||||
GR.clearws()
|
||||
|
||||
_gr_thickness_scaling[1] = plt[:thickness_scaling]
|
||||
dpi_factor = plt[:dpi] / Plots.DPI
|
||||
if fmt == "svg"
|
||||
dpi_factor *= 4
|
||||
@ -655,8 +656,7 @@ function gr_display(plt::Plot, fmt="")
|
||||
|
||||
# compute the viewport_canvas, normalized to the larger dimension
|
||||
viewport_canvas = Float64[0,1,0,1]
|
||||
w, h = plt[:size]
|
||||
gr_plot_size[:] = [w, h]
|
||||
w, h = get_size(plt)
|
||||
if w > h
|
||||
ratio = float(h) / w
|
||||
msize = display_width_ratio * w * dpi_factor
|
||||
@ -676,10 +676,6 @@ function gr_display(plt::Plot, fmt="")
|
||||
# fill in the viewport_canvas background
|
||||
gr_fill_viewport(viewport_canvas, plt[:background_color_outside])
|
||||
|
||||
# update point mult
|
||||
px_per_pt = px / pt
|
||||
_gr_point_mult[1] = 1.5 * _gr_thickness_scaling[1] * px_per_pt / max(h,w)
|
||||
|
||||
# subplots:
|
||||
for sp in plt.subplots
|
||||
gr_display(sp, w*px, h*px, viewport_canvas)
|
||||
@ -692,10 +688,13 @@ end
|
||||
function gr_set_xticks_font(sp)
|
||||
flip = sp[:yaxis][:flip]
|
||||
mirror = sp[:xaxis][:mirror]
|
||||
gr_set_font(tickfont(sp[:xaxis]),
|
||||
gr_set_font(
|
||||
tickfont(sp[:xaxis]),
|
||||
sp,
|
||||
halign = (:left, :hcenter, :right)[sign(sp[:xaxis][:rotation]) + 2],
|
||||
valign = (mirror ? :bottom : :top),
|
||||
rotation = sp[:xaxis][:rotation])
|
||||
rotation = sp[:xaxis][:rotation],
|
||||
)
|
||||
return flip, mirror
|
||||
end
|
||||
|
||||
@ -703,10 +702,13 @@ end
|
||||
function gr_set_yticks_font(sp)
|
||||
flip = sp[:xaxis][:flip]
|
||||
mirror = sp[:yaxis][:mirror]
|
||||
gr_set_font(tickfont(sp[:yaxis]),
|
||||
gr_set_font(
|
||||
tickfont(sp[:yaxis]),
|
||||
sp,
|
||||
halign = (mirror ? :left : :right),
|
||||
valign = (:top, :vcenter, :bottom)[sign(sp[:yaxis][:rotation]) + 2],
|
||||
rotation = sp[:yaxis][:rotation])
|
||||
rotation = sp[:yaxis][:rotation],
|
||||
)
|
||||
return flip, mirror
|
||||
end
|
||||
|
||||
@ -762,10 +764,10 @@ end
|
||||
|
||||
function gr_axis_height(sp, axis)
|
||||
ticks = get_ticks(sp, axis)
|
||||
gr_set_font(tickfont(axis))
|
||||
gr_set_font(tickfont(axis), sp)
|
||||
h = (ticks in (nothing, false, :none) ? 0 : last(gr_get_ticks_size(ticks, axis[:rotation])))
|
||||
if axis[:guide] != ""
|
||||
gr_set_font(guidefont(axis))
|
||||
gr_set_font(guidefont(axis), sp)
|
||||
h += last(gr_text_size(axis[:guide]))
|
||||
end
|
||||
return h
|
||||
@ -773,10 +775,10 @@ end
|
||||
|
||||
function gr_axis_width(sp, axis)
|
||||
ticks = get_ticks(sp, axis)
|
||||
gr_set_font(tickfont(axis))
|
||||
gr_set_font(tickfont(axis), sp)
|
||||
w = (ticks in (nothing, false, :none) ? 0 : first(gr_get_ticks_size(ticks, axis[:rotation])))
|
||||
if axis[:guide] != ""
|
||||
gr_set_font(guidefont(axis))
|
||||
gr_set_font(guidefont(axis), sp)
|
||||
w += last(gr_text_size(axis[:guide]))
|
||||
end
|
||||
return w
|
||||
@ -797,9 +799,9 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
bottompad = 2mm + sp[:bottom_margin]
|
||||
# Add margin for title
|
||||
if sp[:title] != ""
|
||||
gr_set_font(titlefont(sp))
|
||||
gr_set_font(titlefont(sp), sp)
|
||||
l = last(last(gr_text_size(sp[:title])))
|
||||
h = 1mm + gr_plot_size[2] * l * px
|
||||
h = 1mm + get_size(sp)[2] * l * px
|
||||
toppad += h
|
||||
end
|
||||
|
||||
@ -813,20 +815,22 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
tickfont(xaxis),
|
||||
halign = (:left, :hcenter, :right)[sign(xaxis[:rotation]) + 2],
|
||||
valign = (xaxis[:mirror] ? :bottom : :top),
|
||||
rotation = xaxis[:rotation]
|
||||
rotation = xaxis[:rotation],
|
||||
sp
|
||||
)
|
||||
l = 0.01 + last(gr_get_ticks_size(xticks, xaxis[:rotation]))
|
||||
h = max(h, 1mm + gr_plot_size[2] * l * px)
|
||||
h = max(h, 1mm + get_size(sp)[2] * l * px)
|
||||
end
|
||||
if !(yticks in (nothing, false, :none))
|
||||
gr_set_font(
|
||||
tickfont(yaxis),
|
||||
halign = (:left, :hcenter, :right)[sign(yaxis[:rotation]) + 2],
|
||||
valign = (yaxis[:mirror] ? :bottom : :top),
|
||||
rotation = yaxis[:rotation]
|
||||
rotation = yaxis[:rotation],
|
||||
sp
|
||||
)
|
||||
l = 0.01 + last(gr_get_ticks_size(yticks, yaxis[:rotation]))
|
||||
h = max(h, 1mm + gr_plot_size[2] * l * px)
|
||||
h = max(h, 1mm + get_size(sp)[2] * l * px)
|
||||
end
|
||||
if h > 0mm
|
||||
if xaxis[:mirror] || yaxis[:mirror]
|
||||
@ -844,9 +848,10 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
valign = (:top, :vcenter, :bottom)[sign(zaxis[:rotation]) + 2],
|
||||
rotation = zaxis[:rotation],
|
||||
color = zaxis[:tickfontcolor],
|
||||
sp
|
||||
)
|
||||
l = 0.01 + first(gr_get_ticks_size(zticks, zaxis[:rotation]))
|
||||
w = 1mm + gr_plot_size[1] * l * px
|
||||
w = 1mm + get_size(sp)[1] * l * px
|
||||
if zaxis[:mirror]
|
||||
rightpad += w
|
||||
else
|
||||
@ -857,14 +862,14 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
# Add margin for x or y label
|
||||
h = 0mm
|
||||
if xaxis[:guide] != ""
|
||||
gr_set_font(guidefont(sp[:xaxis]))
|
||||
gr_set_font(guidefont(sp[:xaxis]), sp)
|
||||
l = last(gr_text_size(sp[:xaxis][:guide]))
|
||||
h = max(h, 1mm + gr_plot_size[2] * l * px)
|
||||
h = max(h, 1mm + get_size(sp)[2] * l * px)
|
||||
end
|
||||
if yaxis[:guide] != ""
|
||||
gr_set_font(guidefont(sp[:yaxis]))
|
||||
gr_set_font(guidefont(sp[:yaxis]), sp)
|
||||
l = last(gr_text_size(sp[:yaxis][:guide]))
|
||||
h = max(h, 1mm + gr_plot_size[2] * l * px)
|
||||
h = max(h, 1mm + get_size(sp)[2] * l * px)
|
||||
end
|
||||
if h > 0mm
|
||||
if xaxis[:guide_position] == :top || (xaxis[:guide_position] == :auto && xaxis[:mirror] == true)
|
||||
@ -875,9 +880,9 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
end
|
||||
# Add margin for z label
|
||||
if zaxis[:guide] != ""
|
||||
gr_set_font(guidefont(sp[:zaxis]))
|
||||
gr_set_font(guidefont(sp[:zaxis]), sp)
|
||||
l = last(gr_text_size(sp[:zaxis][:guide]))
|
||||
w = 1mm + gr_plot_size[2] * l * px
|
||||
w = 1mm + get_size(sp)[2] * l * px
|
||||
if zaxis[:guide_position] == :right || (zaxis[:guide_position] == :auto && zaxis[:mirror] == true)
|
||||
rightpad += w
|
||||
else
|
||||
@ -890,7 +895,7 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
if !(xticks in (nothing, false, :none))
|
||||
flip, mirror = gr_set_xticks_font(sp)
|
||||
l = 0.01 + last(gr_get_ticks_size(xticks, sp[:xaxis][:rotation]))
|
||||
h = 1mm + gr_plot_size[2] * l * px
|
||||
h = 1mm + get_size(sp)[2] * l * px
|
||||
if mirror
|
||||
toppad += h
|
||||
else
|
||||
@ -900,7 +905,7 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
if !(yticks in (nothing, false, :none))
|
||||
flip, mirror = gr_set_yticks_font(sp)
|
||||
l = 0.01 + first(gr_get_ticks_size(yticks, sp[:yaxis][:rotation]))
|
||||
w = 1mm + gr_plot_size[1] * l * px
|
||||
w = 1mm + get_size(sp)[1] * l * px
|
||||
if mirror
|
||||
rightpad += w
|
||||
else
|
||||
@ -910,9 +915,9 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
|
||||
# Add margin for x label
|
||||
if sp[:xaxis][:guide] != ""
|
||||
gr_set_font(guidefont(sp[:xaxis]))
|
||||
gr_set_font(guidefont(sp[:xaxis]), sp)
|
||||
l = last(gr_text_size(sp[:xaxis][:guide]))
|
||||
h = 1mm + gr_plot_size[2] * l * px
|
||||
h = 1mm + get_size(sp)[2] * l * px
|
||||
if sp[:xaxis][:guide_position] == :top || (sp[:xaxis][:guide_position] == :auto && sp[:xaxis][:mirror] == true)
|
||||
toppad += h
|
||||
else
|
||||
@ -921,9 +926,9 @@ function _update_min_padding!(sp::Subplot{GRBackend})
|
||||
end
|
||||
# Add margin for y label
|
||||
if sp[:yaxis][:guide] != ""
|
||||
gr_set_font(guidefont(sp[:yaxis]))
|
||||
gr_set_font(guidefont(sp[:yaxis]), sp)
|
||||
l = last(gr_text_size(sp[:yaxis][:guide]))
|
||||
w = 1mm + gr_plot_size[2] * l * px
|
||||
w = 1mm + get_size(sp)[2] * l * px
|
||||
if sp[:yaxis][:guide_position] == :right || (sp[:yaxis][:guide_position] == :auto && sp[:yaxis][:mirror] == true)
|
||||
rightpad += w
|
||||
else
|
||||
@ -981,12 +986,12 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
GR.selntran(0)
|
||||
GR.setscale(0)
|
||||
if sp[:legendtitle] !== nothing
|
||||
gr_set_font(legendtitlefont(sp))
|
||||
gr_set_font(legendtitlefont(sp), sp)
|
||||
tbx, tby = gr_inqtext(0, 0, string(sp[:legendtitle]))
|
||||
legendw = tbx[3] - tbx[1]
|
||||
legendn += 1
|
||||
end
|
||||
gr_set_font(legendfont(sp))
|
||||
gr_set_font(legendfont(sp), sp)
|
||||
for series in series_list(sp)
|
||||
should_add_to_legend(series) || continue
|
||||
legendn += 1
|
||||
@ -1000,7 +1005,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
GR.restorestate()
|
||||
end
|
||||
|
||||
dy = _gr_point_mult[1] * sp[:legendfontsize] * 1.75
|
||||
dy = gr_point_mult(sp) * sp[:legendfontsize] * 1.75
|
||||
legendh = dy * legendn
|
||||
leg_str = string(sp[:legend])
|
||||
if occursin("outer", leg_str)
|
||||
@ -1089,7 +1094,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
end
|
||||
|
||||
# draw the axes
|
||||
gr_set_font(tickfont(xaxis))
|
||||
gr_set_font(tickfont(xaxis), sp)
|
||||
GR.setlinewidth(sp.plt[:thickness_scaling])
|
||||
|
||||
if RecipesPipeline.is3d(sp)
|
||||
@ -1108,33 +1113,63 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
|
||||
# draw the grid lines
|
||||
if xaxis[:grid]
|
||||
gr_set_line(xaxis[:gridlinewidth], xaxis[:gridstyle], xaxis[:foreground_color_grid])
|
||||
gr_set_line(
|
||||
xaxis[:gridlinewidth],
|
||||
xaxis[:gridstyle],
|
||||
xaxis[:foreground_color_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(xaxis[:foreground_color_grid], xaxis[:gridalpha])
|
||||
gr_polyline3d(coords(xgrid_segs)...)
|
||||
end
|
||||
if yaxis[:grid]
|
||||
gr_set_line(yaxis[:gridlinewidth], yaxis[:gridstyle], yaxis[:foreground_color_grid])
|
||||
gr_set_line(
|
||||
yaxis[:gridlinewidth],
|
||||
yaxis[:gridstyle],
|
||||
yaxis[:foreground_color_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(yaxis[:foreground_color_grid], yaxis[:gridalpha])
|
||||
gr_polyline3d(coords(ygrid_segs)...)
|
||||
end
|
||||
if zaxis[:grid]
|
||||
gr_set_line(zaxis[:gridlinewidth], zaxis[:gridstyle], zaxis[:foreground_color_grid])
|
||||
gr_set_line(
|
||||
zaxis[:gridlinewidth],
|
||||
zaxis[:gridstyle],
|
||||
zaxis[:foreground_color_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(zaxis[:foreground_color_grid], zaxis[:gridalpha])
|
||||
gr_polyline3d(coords(zgrid_segs)...)
|
||||
end
|
||||
|
||||
if xaxis[:minorgrid]
|
||||
gr_set_line(xaxis[:minorgridlinewidth], xaxis[:minorgridstyle], xaxis[:foreground_color_minor_grid])
|
||||
gr_set_line(
|
||||
xaxis[:minorgridlinewidth],
|
||||
xaxis[:minorgridstyle],
|
||||
xaxis[:foreground_color_minor_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(xaxis[:foreground_color_minor_grid], xaxis[:minorgridalpha])
|
||||
gr_polyline3d(coords(xminorgrid_segs)...)
|
||||
end
|
||||
if yaxis[:minorgrid]
|
||||
gr_set_line(yaxis[:minorgridlinewidth], yaxis[:minorgridstyle], yaxis[:foreground_color_minor_grid])
|
||||
gr_set_line(
|
||||
yaxis[:minorgridlinewidth],
|
||||
yaxis[:minorgridstyle],
|
||||
yaxis[:foreground_color_minor_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(yaxis[:foreground_color_minor_grid], yaxis[:minorgridalpha])
|
||||
gr_polyline3d(coords(yminorgrid_segs)...)
|
||||
end
|
||||
if zaxis[:minorgrid]
|
||||
gr_set_line(zaxis[:minorgridlinewidth], zaxis[:minorgridstyle], zaxis[:foreground_color_minor_grid])
|
||||
gr_set_line(
|
||||
zaxis[:minorgridlinewidth],
|
||||
zaxis[:minorgridstyle],
|
||||
zaxis[:foreground_color_minor_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(zaxis[:foreground_color_minor_grid], zaxis[:minorgridalpha])
|
||||
gr_polyline3d(coords(zminorgrid_segs)...)
|
||||
end
|
||||
@ -1142,17 +1177,17 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
|
||||
# axis lines
|
||||
if xaxis[:showaxis]
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_border])
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_border], sp)
|
||||
GR.setclip(0)
|
||||
gr_polyline3d(coords(xaxis_segs)...)
|
||||
end
|
||||
if yaxis[:showaxis]
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_border])
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_border], sp)
|
||||
GR.setclip(0)
|
||||
gr_polyline3d(coords(yaxis_segs)...)
|
||||
end
|
||||
if zaxis[:showaxis]
|
||||
gr_set_line(1, :solid, zaxis[:foreground_color_border])
|
||||
gr_set_line(1, :solid, zaxis[:foreground_color_border], sp)
|
||||
GR.setclip(0)
|
||||
gr_polyline3d(coords(zaxis_segs)...)
|
||||
end
|
||||
@ -1161,30 +1196,39 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
# axis ticks
|
||||
if xaxis[:showaxis]
|
||||
if sp[:framestyle] in (:zerolines, :grid)
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_grid])
|
||||
gr_set_transparency(xaxis[:foreground_color_grid], xaxis[:tick_direction] == :out ? xaxis[:gridalpha] : 0)
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_grid], sp)
|
||||
gr_set_transparency(
|
||||
xaxis[:foreground_color_grid],
|
||||
xaxis[:tick_direction] == :out ? xaxis[:gridalpha] : 0
|
||||
)
|
||||
else
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_axis])
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_axis], sp)
|
||||
end
|
||||
GR.setclip(0)
|
||||
gr_polyline3d(coords(xtick_segs)...)
|
||||
end
|
||||
if yaxis[:showaxis]
|
||||
if sp[:framestyle] in (:zerolines, :grid)
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_grid])
|
||||
gr_set_transparency(yaxis[:foreground_color_grid], yaxis[:tick_direction] == :out ? yaxis[:gridalpha] : 0)
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_grid], sp)
|
||||
gr_set_transparency(
|
||||
yaxis[:foreground_color_grid],
|
||||
yaxis[:tick_direction] == :out ? yaxis[:gridalpha] : 0
|
||||
)
|
||||
else
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_axis])
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_axis], sp)
|
||||
end
|
||||
GR.setclip(0)
|
||||
gr_polyline3d(coords(ytick_segs)...)
|
||||
end
|
||||
if zaxis[:showaxis]
|
||||
if sp[:framestyle] in (:zerolines, :grid)
|
||||
gr_set_line(1, :solid, zaxis[:foreground_color_grid])
|
||||
gr_set_transparency(zaxis[:foreground_color_grid], zaxis[:tick_direction] == :out ? zaxis[:gridalpha] : 0)
|
||||
gr_set_line(1, :solid, zaxis[:foreground_color_grid], sp)
|
||||
gr_set_transparency(
|
||||
zaxis[:foreground_color_grid],
|
||||
zaxis[:tick_direction] == :out ? zaxis[:gridalpha] : 0
|
||||
)
|
||||
else
|
||||
gr_set_line(1, :solid, zaxis[:foreground_color_axis])
|
||||
gr_set_line(1, :solid, zaxis[:foreground_color_axis], sp)
|
||||
end
|
||||
GR.setclip(0)
|
||||
gr_polyline3d(coords(ztick_segs)...)
|
||||
@ -1200,6 +1244,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
valign = (xaxis[:mirror] ? :bottom : :top),
|
||||
rotation = xaxis[:rotation],
|
||||
color = xaxis[:tickfontcolor],
|
||||
sp
|
||||
)
|
||||
yt = if sp[:framestyle] == :origin
|
||||
0
|
||||
@ -1231,6 +1276,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
valign = (yaxis[:mirror] ? :bottom : :top),
|
||||
rotation = yaxis[:rotation],
|
||||
color = yaxis[:tickfontcolor],
|
||||
sp
|
||||
)
|
||||
xt = if sp[:framestyle] == :origin
|
||||
0
|
||||
@ -1262,6 +1308,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
valign = (:top, :vcenter, :bottom)[sign(zaxis[:rotation]) + 2],
|
||||
rotation = zaxis[:rotation],
|
||||
color = zaxis[:tickfontcolor],
|
||||
sp
|
||||
)
|
||||
xt = if sp[:framestyle] == :origin
|
||||
0
|
||||
@ -1287,10 +1334,10 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
# # border
|
||||
# intensity = sp[:framestyle] == :semi ? 0.5 : 1.0
|
||||
# if sp[:framestyle] in (:box, :semi)
|
||||
# gr_set_line(intensity, :solid, xaxis[:foreground_color_border])
|
||||
# gr_set_line(intensity, :solid, xaxis[:foreground_color_border], sp)
|
||||
# gr_set_transparency(xaxis[:foreground_color_border], intensity)
|
||||
# gr_polyline3d(coords(xborder_segs)...)
|
||||
# gr_set_line(intensity, :solid, yaxis[:foreground_color_border])
|
||||
# gr_set_line(intensity, :solid, yaxis[:foreground_color_border], sp)
|
||||
# gr_set_transparency(yaxis[:foreground_color_border], intensity)
|
||||
# gr_polyline3d(coords(yborder_segs)...)
|
||||
# end
|
||||
@ -1310,26 +1357,43 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
|
||||
# draw the grid lines
|
||||
if xaxis[:grid]
|
||||
# gr_set_linecolor(sp[:foreground_color_grid])
|
||||
# GR.grid(xtick, ytick, 0, 0, majorx, majory)
|
||||
gr_set_line(xaxis[:gridlinewidth], xaxis[:gridstyle], xaxis[:foreground_color_grid])
|
||||
gr_set_line(
|
||||
xaxis[:gridlinewidth],
|
||||
xaxis[:gridstyle],
|
||||
xaxis[:foreground_color_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(xaxis[:foreground_color_grid], xaxis[:gridalpha])
|
||||
gr_polyline(coords(xgrid_segs)...)
|
||||
end
|
||||
if yaxis[:grid]
|
||||
gr_set_line(yaxis[:gridlinewidth], yaxis[:gridstyle], yaxis[:foreground_color_grid])
|
||||
gr_set_line(
|
||||
yaxis[:gridlinewidth],
|
||||
yaxis[:gridstyle],
|
||||
yaxis[:foreground_color_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(yaxis[:foreground_color_grid], yaxis[:gridalpha])
|
||||
gr_polyline(coords(ygrid_segs)...)
|
||||
end
|
||||
if xaxis[:minorgrid]
|
||||
# gr_set_linecolor(sp[:foreground_color_grid])
|
||||
# GR.grid(xtick, ytick, 0, 0, majorx, majory)
|
||||
gr_set_line(xaxis[:minorgridlinewidth], xaxis[:minorgridstyle], xaxis[:foreground_color_minor_grid])
|
||||
gr_set_line(
|
||||
xaxis[:minorgridlinewidth],
|
||||
xaxis[:minorgridstyle],
|
||||
xaxis[:foreground_color_minor_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(xaxis[:foreground_color_minor_grid], xaxis[:minorgridalpha])
|
||||
gr_polyline(coords(xminorgrid_segs)...)
|
||||
end
|
||||
if yaxis[:minorgrid]
|
||||
gr_set_line(yaxis[:minorgridlinewidth], yaxis[:minorgridstyle], yaxis[:foreground_color_minor_grid])
|
||||
gr_set_line(
|
||||
yaxis[:minorgridlinewidth],
|
||||
yaxis[:minorgridstyle],
|
||||
yaxis[:foreground_color_minor_grid],
|
||||
sp
|
||||
)
|
||||
gr_set_transparency(yaxis[:foreground_color_minor_grid], yaxis[:minorgridalpha])
|
||||
gr_polyline(coords(yminorgrid_segs)...)
|
||||
end
|
||||
@ -1337,12 +1401,12 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
|
||||
# axis lines
|
||||
if xaxis[:showaxis]
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_border])
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_border], sp)
|
||||
GR.setclip(0)
|
||||
gr_polyline(coords(xspine_segs)...)
|
||||
end
|
||||
if yaxis[:showaxis]
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_border])
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_border], sp)
|
||||
GR.setclip(0)
|
||||
gr_polyline(coords(yspine_segs)...)
|
||||
end
|
||||
@ -1351,20 +1415,26 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
# axis ticks
|
||||
if xaxis[:showaxis]
|
||||
if sp[:framestyle] in (:zerolines, :grid)
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_grid])
|
||||
gr_set_transparency(xaxis[:foreground_color_grid], xaxis[:tick_direction] == :out ? xaxis[:gridalpha] : 0)
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_grid], sp)
|
||||
gr_set_transparency(
|
||||
xaxis[:foreground_color_grid],
|
||||
xaxis[:tick_direction] == :out ? xaxis[:gridalpha] : 0
|
||||
)
|
||||
else
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_axis])
|
||||
gr_set_line(1, :solid, xaxis[:foreground_color_axis], sp)
|
||||
end
|
||||
GR.setclip(0)
|
||||
gr_polyline(coords(xtick_segs)...)
|
||||
end
|
||||
if yaxis[:showaxis]
|
||||
if sp[:framestyle] in (:zerolines, :grid)
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_grid])
|
||||
gr_set_transparency(yaxis[:foreground_color_grid], yaxis[:tick_direction] == :out ? yaxis[:gridalpha] : 0)
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_grid], sp)
|
||||
gr_set_transparency(
|
||||
yaxis[:foreground_color_grid],
|
||||
yaxis[:tick_direction] == :out ? yaxis[:gridalpha] : 0
|
||||
)
|
||||
else
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_axis])
|
||||
gr_set_line(1, :solid, yaxis[:foreground_color_axis], sp)
|
||||
end
|
||||
GR.setclip(0)
|
||||
gr_polyline(coords(ytick_segs)...)
|
||||
@ -1397,10 +1467,10 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
intensity = sp[:framestyle] == :semi ? 0.5 : 1
|
||||
if sp[:framestyle] in (:box, :semi)
|
||||
GR.setclip(0)
|
||||
gr_set_line(intensity, :solid, xaxis[:foreground_color_border])
|
||||
gr_set_line(intensity, :solid, xaxis[:foreground_color_border], sp)
|
||||
gr_set_transparency(xaxis[:foreground_color_border], intensity)
|
||||
gr_polyline(coords(xborder_segs)...)
|
||||
gr_set_line(intensity, :solid, yaxis[:foreground_color_border])
|
||||
gr_set_line(intensity, :solid, yaxis[:foreground_color_border], sp)
|
||||
gr_set_transparency(yaxis[:foreground_color_border], intensity)
|
||||
gr_polyline(coords(yborder_segs)...)
|
||||
GR.setclip(1)
|
||||
@ -1411,7 +1481,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
# add the guides
|
||||
GR.savestate()
|
||||
if sp[:title] != ""
|
||||
gr_set_font(titlefont(sp))
|
||||
gr_set_font(titlefont(sp), sp)
|
||||
loc = sp[:titlelocation]
|
||||
if loc == :left
|
||||
xpos = viewport_plotarea[1]
|
||||
@ -1432,7 +1502,8 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
guidefont(xaxis),
|
||||
halign = (:left, :hcenter, :right)[sign(xaxis[:rotation]) + 2],
|
||||
valign = (xaxis[:mirror] ? :bottom : :top),
|
||||
rotation = xaxis[:rotation]
|
||||
rotation = xaxis[:rotation],
|
||||
sp
|
||||
)
|
||||
yg = xor(xaxis[:mirror], yaxis[:flip]) ? ymax : ymin
|
||||
zg = xor(xaxis[:mirror], zaxis[:flip]) ? zmax : zmin
|
||||
@ -1447,7 +1518,8 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
guidefont(yaxis),
|
||||
halign = (:left, :hcenter, :right)[sign(yaxis[:rotation]) + 2],
|
||||
valign = (yaxis[:mirror] ? :bottom : :top),
|
||||
rotation = yaxis[:rotation]
|
||||
rotation = yaxis[:rotation],
|
||||
sp
|
||||
)
|
||||
xg = xor(yaxis[:mirror], xaxis[:flip]) ? xmin : xmax
|
||||
yg = (ymin + ymax) / 2
|
||||
@ -1462,7 +1534,8 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
guidefont(zaxis),
|
||||
halign = (:left, :hcenter, :right)[sign(zaxis[:rotation]) + 2],
|
||||
valign = (zaxis[:mirror] ? :bottom : :top),
|
||||
rotation = zaxis[:rotation]
|
||||
rotation = zaxis[:rotation],
|
||||
sp
|
||||
)
|
||||
xg = xor(zaxis[:mirror], xaxis[:flip]) ? xmax : xmin
|
||||
yg = xor(zaxis[:mirror], yaxis[:flip]) ? ymax : ymin
|
||||
@ -1475,7 +1548,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
else
|
||||
if xaxis[:guide] != ""
|
||||
h = 0.01 + gr_axis_height(sp, xaxis)
|
||||
gr_set_font(guidefont(xaxis))
|
||||
gr_set_font(guidefont(xaxis), sp)
|
||||
if xaxis[:guide_position] == :top || (xaxis[:guide_position] == :auto && xaxis[:mirror] == true)
|
||||
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_TOP)
|
||||
gr_text(gr_view_xcenter(viewport_plotarea), viewport_plotarea[4] + h, xaxis[:guide])
|
||||
@ -1487,7 +1560,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
|
||||
if yaxis[:guide] != ""
|
||||
w = 0.02 + gr_axis_width(sp, yaxis)
|
||||
gr_set_font(guidefont(yaxis))
|
||||
gr_set_font(guidefont(yaxis), sp)
|
||||
GR.setcharup(-1, 0)
|
||||
if yaxis[:guide_position] == :right || (yaxis[:guide_position] == :auto && yaxis[:mirror] == true)
|
||||
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_BOTTOM)
|
||||
@ -1500,7 +1573,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
end
|
||||
GR.restorestate()
|
||||
|
||||
gr_set_font(tickfont(xaxis))
|
||||
gr_set_font(tickfont(xaxis), sp)
|
||||
|
||||
# this needs to be here to point the colormap to the right indices
|
||||
GR.setcolormap(1000 + GR.COLORMAP_COOLWARM)
|
||||
@ -1568,7 +1641,9 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
if st in (:path, :straightline)
|
||||
for (i, rng) in enumerate(segments)
|
||||
lc = get_linecolor(series, clims, i)
|
||||
gr_set_line(get_linewidth(series, i), get_linestyle(series, i), lc) #, series[:linealpha])
|
||||
gr_set_line(
|
||||
get_linewidth(series, i), get_linestyle(series, i), lc, sp
|
||||
)
|
||||
arrowside = isa(series[:arrow], Arrow) ? series[:arrow].side : :none
|
||||
arrowstyle = isa(series[:arrow], Arrow) ? series[:arrow].style : :simple
|
||||
gr_set_fillcolor(lc)
|
||||
@ -1585,7 +1660,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
elseif st == :contour
|
||||
GR.setspace(clims[1], clims[2], 0, 90)
|
||||
GR.setlinetype(gr_linetype(get_linestyle(series)))
|
||||
GR.setlinewidth(max(0, get_linewidth(series)) / nominal_size())
|
||||
GR.setlinewidth(max(0, get_linewidth(series)) / nominal_size(sp))
|
||||
is_lc_black = let black=plot_color(:black)
|
||||
plot_color(series[:linecolor]) in (black,[black])
|
||||
end
|
||||
@ -1675,7 +1750,9 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
segments = iter_segments(series)
|
||||
for (i, rng) in enumerate(segments)
|
||||
lc = get_linecolor(series, clims, i)
|
||||
gr_set_line(get_linewidth(series, i), get_linestyle(series, i), lc) #, series[:linealpha])
|
||||
gr_set_line(
|
||||
get_linewidth(series, i), get_linestyle(series, i), lc, sp
|
||||
)
|
||||
gr_set_transparency(lc, get_linealpha(series, i))
|
||||
GR.polyline3d(x[rng], y[rng], z[rng])
|
||||
end
|
||||
@ -1706,7 +1783,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
|
||||
# draw the shapes
|
||||
lc = get_linecolor(series, clims, i)
|
||||
gr_set_line(get_linewidth(series, i), get_linestyle(series, i), lc)
|
||||
gr_set_line(get_linewidth(series, i), get_linestyle(series, i), lc, sp)
|
||||
gr_set_transparency(lc, get_linealpha(series, i))
|
||||
GR.polyline(xseg, yseg)
|
||||
end
|
||||
@ -1726,12 +1803,12 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
# this is all we need to add the series_annotations text
|
||||
anns = series[:series_annotations]
|
||||
for (xi,yi,str,fnt) in EachAnn(anns, x, y)
|
||||
gr_set_font(fnt)
|
||||
gr_set_font(fnt, sp)
|
||||
gr_text(GR.wctondc(xi, yi)..., str)
|
||||
end
|
||||
|
||||
if sp[:legend] == :inline && should_add_to_legend(series)
|
||||
gr_set_font(legendfont(sp))
|
||||
gr_set_font(legendfont(sp), sp)
|
||||
gr_set_textcolor(plot_color(sp[:legendfontcolor]))
|
||||
if sp[:yaxis][:mirror]
|
||||
(_,i) = sp[:xaxis][:flip] ? findmax(x) : findmin(x)
|
||||
@ -1756,32 +1833,32 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
GR.savestate()
|
||||
GR.selntran(0)
|
||||
GR.setscale(0)
|
||||
gr_set_font(legendfont(sp))
|
||||
gr_set_font(legendfont(sp), sp)
|
||||
w = legendw
|
||||
n = legendn
|
||||
if w > 0
|
||||
dy = _gr_point_mult[1] * sp[:legendfontsize] * 1.75
|
||||
dy = gr_point_mult(sp) * sp[:legendfontsize] * 1.75
|
||||
h = dy*n
|
||||
xpos, ypos = gr_legend_pos(sp, w, h, viewport_plotarea)
|
||||
GR.setfillintstyle(GR.INTSTYLE_SOLID)
|
||||
gr_set_fillcolor(sp[:background_color_legend])
|
||||
GR.fillrect(xpos - 0.08, xpos + w + 0.02, ypos + dy, ypos - dy * n)
|
||||
gr_set_line(1, :solid, sp[:foreground_color_legend])
|
||||
gr_set_line(1, :solid, sp[:foreground_color_legend], sp)
|
||||
GR.drawrect(xpos - 0.08, xpos + w + 0.02, ypos + dy, ypos - dy * n)
|
||||
i = 0
|
||||
if sp[:legendtitle] !== nothing
|
||||
GR.settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_HALF)
|
||||
gr_set_font(legendtitlefont(sp))
|
||||
gr_set_font(legendtitlefont(sp), sp)
|
||||
gr_text(xpos - 0.03 + 0.5*w, ypos, string(sp[:legendtitle]))
|
||||
ypos -= dy
|
||||
gr_set_font(legendfont(sp))
|
||||
gr_set_font(legendfont(sp), sp)
|
||||
end
|
||||
for series in series_list(sp)
|
||||
clims = get_clims(sp, series)
|
||||
should_add_to_legend(series) || continue
|
||||
st = series[:seriestype]
|
||||
lc = get_linecolor(series, clims)
|
||||
gr_set_line(sp[:legendfontsize] / 8, get_linestyle(series), lc) #, series[:linealpha])
|
||||
gr_set_line(sp[:legendfontsize] / 8, get_linestyle(series), lc, sp)
|
||||
|
||||
if (st == :shape || series[:fillrange] !== nothing) && series[:ribbon] === nothing
|
||||
fc = get_fillcolor(series, clims)
|
||||
@ -1794,7 +1871,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
gr_polyline(x, y, GR.fillarea)
|
||||
lc = get_linecolor(series, clims)
|
||||
gr_set_transparency(lc, get_linealpha(series))
|
||||
gr_set_line(get_linewidth(series), get_linestyle(series), lc)
|
||||
gr_set_line(get_linewidth(series), get_linestyle(series), lc, sp)
|
||||
st == :shape && gr_polyline(x, y)
|
||||
end
|
||||
|
||||
@ -1849,7 +1926,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
||||
else
|
||||
GR.wctondc(x, y)
|
||||
end
|
||||
gr_set_font(val.font)
|
||||
gr_set_font(val.font, sp)
|
||||
gr_text(x, y, val.str)
|
||||
end
|
||||
GR.restorestate()
|
||||
|
||||
10
src/utils.jl
10
src/utils.jl
@ -624,6 +624,16 @@ function get_aspect_ratio(sp)
|
||||
return aspect_ratio
|
||||
end
|
||||
|
||||
get_size(kw) = get(kw, :size, default(:size))
|
||||
get_size(plt::Plot) = get_size(plt.attr)
|
||||
get_size(sp::Subplot) = get_size(sp.plt)
|
||||
get_size(series::Series) = get_size(series.plotattributes[:sp])
|
||||
|
||||
get_thickness_scaling(kw) = get(kw, :thickness_scaling, default(:thickness_scaling))
|
||||
get_thickness_scaling(plt::Plot) = get_thickness_scaling(plt.attr)
|
||||
get_thickness_scaling(sp::Subplot) = get_thickness_scaling(sp.plt)
|
||||
get_thickness_scaling(series::Series) = get_thickness_scaling(series.plotattributes[:sp])
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
makekw(; kw...) = KW(kw)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user