fix computing marker coordinates with log scales
This commit is contained in:
parent
c046e6461f
commit
946f90d3e4
@ -326,13 +326,15 @@ end
|
|||||||
# draw ONE Shape
|
# draw ONE Shape
|
||||||
function gr_draw_marker(series, xi, yi, clims, i, msize, strokewidth, shape::Shape)
|
function gr_draw_marker(series, xi, yi, clims, i, msize, strokewidth, shape::Shape)
|
||||||
sx, sy = coords(shape)
|
sx, sy = coords(shape)
|
||||||
# convert to ndc coords (percentages of window)
|
# convert to ndc coords (percentages of window) ...
|
||||||
GR.selntran(0)
|
|
||||||
w, h = get_size(series)
|
w, h = get_size(series)
|
||||||
f = msize / (w + h)
|
f = msize / (w + h)
|
||||||
|
|
||||||
xi, yi = GR.wctondc(xi, yi)
|
xi, yi = GR.wctondc(xi, yi)
|
||||||
xs = xi .+ sx .* f
|
|
||||||
ys = yi .+ sy .* f
|
# ... convert back to world coordinates
|
||||||
|
xs_ys = GR.ndctowc.(xi .+ sx .* f, yi .+ sy .* f)
|
||||||
|
xs, ys = getindex.(xs_ys, 1), getindex.(xs_ys, 2)
|
||||||
|
|
||||||
# draw the interior
|
# draw the interior
|
||||||
mc = get_markercolor(series, clims, i)
|
mc = get_markercolor(series, clims, i)
|
||||||
@ -345,7 +347,6 @@ function gr_draw_marker(series, xi, yi, clims, i, msize, strokewidth, shape::Sha
|
|||||||
gr_set_line(strokewidth, :solid, msc, series)
|
gr_set_line(strokewidth, :solid, msc, series)
|
||||||
gr_set_transparency(msc, get_markerstrokealpha(series, i))
|
gr_set_transparency(msc, get_markerstrokealpha(series, i))
|
||||||
GR.polyline(xs, ys)
|
GR.polyline(xs, ys)
|
||||||
GR.selntran(1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function gr_nominal_size(s)
|
function gr_nominal_size(s)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user