|
From: sfeam <sf...@us...> - 2017-09-02 15:24:15
|
On Friday, 01 September 2017 23:49:39 Dima Kogan wrote:
>
> Ethan A Merritt <sf...@us...> writes:
>
> > On Friday, 01 September, 2017 13:01:40 Dima Kogan wrote:
> >> Dima Kogan <gn...@di...> writes:
> >>
> >> > 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?
> >>
> >> To (partly) answer my own question: the x1y1 axis is rendered to the
> >> screen. So if I take the gnuplot script in question and
> >>
> >> 1. switch the forward/backward transforms in the 'set link' commands
> >> 2. change the plot command to 'axis x1y1' from 'axis x2y2'
> >> 3. change the range specs from touching the x1,y1 axes to the x2,y2 axes
> >>
> >> then the rendered plots look fine even without the "pixels". This is
> >> because in this case, the pixels live on the x1y1 axis, which is then
> >> linear with the output terminal axes, and the y2 axis is then the
> >> nonlinear one, but this doesn't directly affect the rendering.
> >
> > It may "look fine" but only one of the two treatments can be correct.
> > One places the pixels on an evenly spaced grid, the other does not.
> > The two rendered maps are different, although both now have a marker
> > on top of LA. Both maps are distorted from what I am used to seeing
> > so I cannot say which is intended.
>
> I guess there are 3 sets of coordinates that are being related to one
> another:
>
> 1. Pixel coordinates in the rgbimage being plotted
> 2. Gnuplot x1/y1/x2/y2 coordinates
> 3. Terminal coordinates of the output
>
> I THINK gnuplot always maps x1 and y1 linearly into the terminal
> coordinates, NOT x2 and y2; please tell me if this is wrong.
The x1 and y1 axes may also be nonlinear, but it requires a command
like
set nonlinear x via f(x) inverse g(x)
The "set link" command will not by itself change the linearity of x1 or y1.
The x2 and y2 axes can also be made nonlinear by a "set link" command.
Ethan
> At the beginning of this thread I was plotting the rgbimage into x2y2,
> this was nonlinearly mapped to x1y1, which was in turn linearly mapped
> into the terminal coords. I.e. the bitmap was being nonlinearly warped.
>
> With the variation above, the rgbimage goes into x1y1, so the terminal
> output warps the image linearly-only, and the x1y2 axes instead show the
> nonlinearity.
>
> The distortion you're seeing is likely due to the linear scaling of the
> x1y1 axes. If you 'set size ratio -1' then you should see exactly the
> images you see at openstreetmap.org, which look "normal" to me since
> I've been looking at them for many years.
>
> Thanks for the help.
|