From: Ethan A M. <me...@uw...> - 2020-06-30 07:16:14
|
On Monday, 29 June 2020 20:55:26 PDT Dima Kogan wrote: > Ethan A Merritt <me...@uw...> writes: > > > On Monday, 29 June 2020 19:51:04 PDT Dima Kogan wrote: > >> Alright, I debugged this (rr was invaluable), and I know mostly what's > >> going on. The flow is roughly this: > >> > >> 1. The data is read here: > >> > >> https://sourceforge.net/p/gnuplot/gnuplot-main/ci/branch-5-4-stable/tree/src/plot3d.c#l1037 > >> > >> At the end of the first line, x is 3999.0000000000005, which is just outside the > >> xrange [0:3999]. This isn't unexpected due to the "using" expression > > > > But the x coordinates should come out identically the same in the "good" and "bad" > > cases, right? So how does this explain a different between them? > > In the "good" case we're getting lucky in step 5. The corners (which > were out-of-bounds in step 2, and were thus ignored for computing > view_port_z[]) still end up in-bounds in step 5. There's an extra step > that I didn't mention in the previous email: Very strange. The z range should be totally irrelevant to "set view map". z as a coordinate doesn't matter because it's in projection. z as an image pixel value doesn't matter because the image grid doesn't care about the pixel value, only the number of pixels. But you're right, it does seem to make a difference in this case For instance: gnuplot> splot $MATRIX matrix using ($1*266.6):($2*199.9090909090909):3 title "" with image warning: Visible pixel grid has a scan line longer than previous scan lines. gnuplot> splot $MATRIX matrix using ($1*266.6):($2*199.9090909090909):(0):3 title "" with image works with no problem But opening up the z range explicitly does not fix the problem. So I still don't understand exactly what's going on here. I'll look harder tomorrow, Ethan > 3.5. We expand the autoranged axis extents to nice, round numbers: > > https://sourceforge.net/p/gnuplot/gnuplot-main/ci/branch-5-4-stable/tree/src/axis.c#l960 > > This provides some margin so that getting lucky in this way is possible. |