Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2893 > unrolled thread

with image and corners2color

Started byVasilis <vvlachoudis@gmail.com>
First post2015-05-06 06:12 -0700
Last post2015-05-07 15:28 -0700
Articles 4 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  with image and corners2color Vasilis <vvlachoudis@gmail.com> - 2015-05-06 06:12 -0700
    Re: with image and corners2color Ethan A Merritt <sfeam@users.sourceforge.net> - 2015-05-06 11:28 -0700
      Re: with image and corners2color Vasilis <vvlachoudis@gmail.com> - 2015-05-06 23:44 -0700
        Re: with image and corners2color Ethan A Merritt <sfeam@users.sourceforge.net> - 2015-05-07 15:28 -0700

#2893 — with image and corners2color

FromVasilis <vvlachoudis@gmail.com>
Date2015-05-06 06:12 -0700
Subjectwith image and corners2color
Message-ID<cea3c52e-78ed-448c-915b-f9bf269fcb88@googlegroups.com>
Hi all,

In my program I am generating a lot of 2D color plots. For the moment I was making splots, using the "set pm3d map explicit corners2color c1"
to map to the lower left corner of the pixel.

I've tried to convert it to 2d plots using the "with image" but now the pixel
is centered on the value. So all colors are shifted by half pixel in both dimensions.

Is there a way to use a similar setting as corners2color for the "with image" command

Thanks in advance
Vasilis

[toc] | [next] | [standalone]


#2894

FromEthan A Merritt <sfeam@users.sourceforge.net>
Date2015-05-06 11:28 -0700
Message-ID<midmdu$kln$1@dont-email.me>
In reply to#2893
Vasilis wrote:

> Hi all,
> 
> In my program I am generating a lot of 2D color plots. For the moment I
> was making splots, using the "set pm3d map explicit corners2color c1" to
> map to the lower left corner of the pixel.
> 
> I've tried to convert it to 2d plots using the "with image" but now the
> pixel is centered on the value. So all colors are shifted by half pixel in
> both dimensions.
> 
> Is there a way to use a similar setting as corners2color for the "with
> image" command

Gnuplot does not do any averaging or reassignment of pixel color within
an image.  

If the issue is just a coordinate offset, note that you can control the
origin and scaling (pixels size) of an image using additional keywords
origin=<XX,YY> dx=<DX> dy=<DY> 

Examples:
	http://gnuplot.sourceforge.net/demo_cvs/image.html 
	http://gnuplot.sourceforge.net/demo_cvs/barchart_art.html

It is also possible that you can simply use the same splot+pm3d
commands you already have and produce a 2D plot by first saying
"set view map".

	Ethan


> 
> Thanks in advance
> Vasilis

[toc] | [prev] | [next] | [standalone]


#2895

FromVasilis <vvlachoudis@gmail.com>
Date2015-05-06 23:44 -0700
Message-ID<5a4aaebd-85ab-4dce-bcff-0beee9b03379@googlegroups.com>
In reply to#2894
Thank you Ethan,

the file I am using is not an image is a file containing
x y z1
x+dx y z2
...

x y+dy z11
x+dx y+dy z12
...

coordinates as a 3D histogram
that I was plotting with splot as pm3d map
Using the plot "with image" it works exactly as before
however the z-color mapped value now is not starting from
the x,y (lower-left) coordinate but from x-dx/2,y-dy/2
so it is centred around x,y

V.

[toc] | [prev] | [next] | [standalone]


#2896

FromEthan A Merritt <sfeam@users.sourceforge.net>
Date2015-05-07 15:28 -0700
Message-ID<migosv$m47$1@dont-email.me>
In reply to#2895
Vasilis wrote:

> Thank you Ethan,
> 
> the file I am using is not an image is a file containing
> x y z1
> x+dx y z2
> ...
> 
> x y+dy z11
> x+dx y+dy z12
> ...
> 
> coordinates as a 3D histogram
> that I was plotting with splot as pm3d map
> Using the plot "with image" it works exactly as before
> however the z-color mapped value now is not starting from
> the x,y (lower-left) coordinate but from x-dx/2,y-dy/2
> so it is centred around x,y

Yes, that is how the image styles are defined.

If you are asking how to reposition the origin of the pixels,
how about

   plot 'file' using ($1 + dx/2) : ($2 + dy/2) : 3 with image

	Ethan

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web