From: Ethan A M. <sf...@us...> - 2017-09-01 19:53:53
|
On Friday, 01 September, 2017 10:01:26 Dima Kogan wrote: > sfeam <sf...@us...> writes: > > > On Thursday, 31 August 2017 23:51:37 Dima Kogan wrote: > >> sfeam <sf...@us...> writes: > >> > >> > On Thursday, 31 August 2017 22:44:01 Dima Kogan wrote: > >> >> Hi. I just stumbled on another bug with rgbimages. If somebody knows > >> >> what's causing it, that'd be appreciated. > >> > > >> > This is a very complicated one. > >> > I'll look at it in more detail over the weekend. > > > > Never mind. I realized the problem overnight. > > The "with image" family of plot styles (image rgbimage rgbalpha) use > > a terminal-specific bitmap display routine if the terminal provides one. > > This can be much faster than sending the pixels one-by-one. > > But that only works correctly for linear coordinates, because the > > only information sent is basically "fill this rectangle with this bitmap". > > > > You have nonlinear axes so you need to fall back to calculating the > > pixel coordinates individually. The keyword for this is "pixels". > > So this morning's test is: > > > > set xrange [-120:-80] noextend > > set yrange [20:60] noextend > > > > plot "montage_40_-99_1300miles_4.png" \ > > binary filetype=png flipy axes x2y2 with rgbimage pixels notitle, \ > > $POINT axes x2y2 with points pt 1 ps 2 > > > > That seems to work correctly (although slower). > > Aha. That makes it work for me too. Thanks! Two questions: > > 1. Can we detect this failure and throw a warning, maybe? Or turn on > "pixels" mode automatically? We can detect if the axis is mapped by "set link" or "set nonlinear", but not whether the mapping is truly linear or nonlinear. If the mapping is linear then the optimized bitmap transfer should still work. So I don't think we want to fall back to pixels mode just because a mapping exists. > 2. Here I have pixels on x2y2 and latlon on xy. It also appears that the > thing that gets drawn on the plot is linear in xy, so the image requires > a nonlinear transformation (and thus we need the "pixels" option). How > is it decided what is drawn on the plot? What if I wanted the drawn > output to be linear in the pixels, but the rendered axes to be > nonlinear? Is this a specifiable choice, or does gnuplot always pick the > xy axes to render? I don't understand the question. When you specify coordinates for a drawable object or graph component you have to tell the program what axial system the coordinates belong to. See "help coordinates". The x y x2 y2 axes are normally linear. You can change this by providing forward and reverse mapping functions, either mapping onto a hidden linear axis ("set nonlinear") or a paired visible axis ("set link"). In the current version of gnuplot you cannot use "set link" to make both of the paired axes nonlinear; you would have to manually set up mappings for both using "set nonlinear" and then set the corresponding range endpoints for both. Does that help? Ethan |