Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Skip invalid points in gr_hexbin routine

See merge request Scientific-IT-Systems/gr!178
  • Loading branch information
jheinen committed Apr 2, 2019
2 parents c272562 + 13e5638 commit 379340a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/gr/gr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6744,8 +6744,13 @@ static int binning(double x[], double y[], int *cell, int *cnt, double size, dou

for (i = 0; i < n; i++)
{
xi = nx.a * x_lin(x[i]) + nx.b;
yi = nx.c * y_lin(y[i]) + nx.d;
xi = x[i];
yi = y[i];
gr_wctondc(&xi, &yi);
if (xi < vxmin || xi > vxmax || yi < vymin || yi > vymax)
{
continue;
}
sx = c1 * (xi - xmin);
sy = c2 * (yi - ymin);
j1 = sx + 0.5;
Expand Down Expand Up @@ -6883,8 +6888,9 @@ int gr_hexbin(int n, double *x, double *y, int nbins)
{
for (j = 0; j < 6; j++)
{
xlist[j] = x_log(xcm[i] + xdelta[j] - nx.b) / nx.a;
ylist[j] = y_log(ycm[i] + ydelta[j] - nx.d) / nx.c;
xlist[j] = xcm[i] + xdelta[j];
ylist[j] = ycm[i] + ydelta[j];
gr_ndctowc(xlist + j, ylist + j);
}
xlist[6] = xlist[0];
ylist[6] = ylist[0];
Expand Down

0 comments on commit 379340a

Please sign in to comment.