Merge pull request #874 from jheinen/master

gr: fixed several bugs
This commit is contained in:
Josef Heinen 2017-05-30 10:31:17 +02:00 committed by GitHub
commit 3baceb9dc4
2 changed files with 6 additions and 4 deletions

View File

@ -76,6 +76,8 @@ const gr_markertype = KW(
:diamond => -13,
:utriangle => -3,
:dtriangle => -5,
:ltriangle => -18,
:rtriangle => -17,
:pentagon => -21,
:hexagon => -22,
:heptagon => -23,
@ -678,7 +680,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
# use xor ($) to get the right y coords
xi, yi = GR.wctondc(cv, (flip $ mirror) ? ymax : ymin)
# @show cv dv ymin xi yi flip mirror (flip $ mirror)
gr_text(xi, yi + (mirror ? 1 : -1) * 1e-2, string(dv))
gr_text(xi, yi + (mirror ? 1 : -1) * 5e-3, string(dv))
end
end
@ -880,7 +882,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
GR.selntran(0)
GR.setfillintstyle(GR.INTSTYLE_SOLID)
xmin, xmax, ymin, ymax = viewport_plotarea
ymax -= 0.05 * (xmax - xmin)
ymax -= 0.1 * (xmax - xmin)
xcenter = 0.5 * (xmin + xmax)
ycenter = 0.5 * (ymin + ymax)
if xmax - xmin > ymax - ymin
@ -944,7 +946,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
elseif st == :image
z = transpose_z(series, series[:z].surf, true)
z = transpose_z(series, series[:z].surf, true)'
w, h = size(z)
if eltype(z) <: Colors.AbstractGray
grey = round(UInt8, float(z) * 255)

View File

@ -350,7 +350,7 @@ end
function convert_to_polar(x, y, r_extrema = calc_r_extrema(x, y))
rmin, rmax = r_extrema
phi, r = x, y
r = 0.5 * (r - rmin) / (rmax - rmin)
r = (r - rmin) / (rmax - rmin)
n = max(length(phi), length(r))
x = zeros(n)
y = zeros(n)