Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

2D color graph (z size as a color)

4,931 views
Skip to first unread message

1sez...@gmail.com

unread,
Oct 10, 2008, 10:34:43 AM10/10/08
to
Is there any possibility to draw a 2D color graph by using z as a
color scale.
With the code which I pasted below, it is possible. But my problem is
that; it connects between 2 point because of pm3d features. Is it
possible to disable it and make every value separately just a point?
Thanks to who reply :-)
Sezgin

set border 4095 front linetype -1 linewidth 1.000
set view map
set samples 50, 50
set isosamples 50, 50
unset surface
set style data pm3d
set style function pm3d
set ticslevel 0
set title "colour map,"
set xlabel "x"
set xrange [ 0.0000 : 50.0000 ] noreverse nowriteback
set ylabel "y"
set yrange [ 0.0000 : 50.0000 ] noreverse nowriteback
set zrange [ 0.0000 : 100.00000 ] noreverse nowriteback
set pm3d implicit at b
splot "asciidata.dat"

Data
# X Y Z
1 49 2
2 48 4
3 47 1
4 46 8
5 45 10
6 44 12
7 43 14
8 42 20
9 41 18
10 40 20
11 39 22
12 38 24
13 37 70
14 36 28
47 3 1
46 4 8
45 5 10
44 6 12
43 7 14
42 8 20

41 9 18
40 1 2 0
39 1 2 2
38 1 24
37 1 70

1sez...@gmail.com

unread,
Oct 10, 2008, 10:38:40 AM10/10/08
to

sfeam

unread,
Oct 10, 2008, 2:30:15 PM10/10/08
to
1sez...@gmail.com wrote:

> Is there any possibility to draw a 2D color graph by using z as a
> color scale.

Yes, in recent versions of gnuplot (newer than 4.2.2) you can color
by z value in 2D plots. Current version is 4.2.4
You do not need to use the pm3d commands for this.

sezgin

unread,
Oct 14, 2008, 2:51:09 AM10/14/08
to
I am using version 4.2 patchlevel4.
is there any clue how can I do without pm3d?

On Oct 10, 8:30 pm, sfeam <sf...@users.sourceforge.net> wrote:

sfeam

unread,
Oct 14, 2008, 1:19:51 PM10/14/08
to
sezgin wrote:

> I am using version 4.2 patchlevel4.
> is there any clue how can I do without pm3d?

There are actually many different ways, depending on exactly what
king of plot you want to make.

Here is an example of 2D heat maps:
http://gnuplot.sourceforge.net/demo_4.3/heatmaps.html

sezgin

unread,
Oct 15, 2008, 2:53:10 AM10/15/08
to
I was looking to plot (a data like I wrote)
http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thread/thread/97f1692f12ebcb3b
to get this image http://tinyurl.com/5nzmn6
But macro which I find is not working for my data it gives "Axis
range undefined due to improper data values. NaN? Inf?" error
message.
What can I do to run this macro to get my data plotted?(I am not
experienced on gnuplot)

> >> You do not need to use the pm3d commands for this.- Hide quoted text -
>
> - Show quoted text -

Petr Mikulik

unread,
Oct 15, 2008, 3:39:32 AM10/15/08
to sezgin
> I am using version 4.2 patchlevel4.
> is there any clue how can I do without pm3d?

splot '...' with points palette

sfeam

unread,
Oct 15, 2008, 2:57:34 PM10/15/08
to
sezgin wrote:

> I was looking to plot (a data like I wrote)
>
http://groups.google.com/group/comp.graphics.apps.gnuplot/browse_thread/thread/97f1692f12ebcb3b
> to get this image http://tinyurl.com/5nzmn6
> But macro which I find is not working for my data it gives "Axis
> range undefined due to improper data values. NaN? Inf?" error
> message.

It is possible that the auto-scaling code is not being triggered.
My guess is that if you set explicit ranges for z and for the
color palette, you will not see this problem.

MIN = 0.
MAX = 500.
set zrange [MIN:MAX]
set cbrange [MIN:MAX]

Petr Mikulik

unread,
Oct 15, 2008, 4:25:14 PM10/15/08
to sezgin
> But macro which I find is not working for my data it gives "Axis
> range undefined due to improper data values. NaN? Inf?" error
> message.

You probably need:
set cbrange [10:1000]
set xrange [-10:100]
set yrange ...
set zrange ...

---
PM

sezgin

unread,
Oct 27, 2008, 8:47:26 AM10/27/08
to
Thanks to every one who reply me,
As a result, I obtained my graph by using this code.

set xlabel 'A1'
set ylabel 'B1'
set view map
set palette rgbformulae 10,13,33
set cbrange [0:500]
set xrange [0:50]
set yrange [0:50]
set term png size 840,840
set output 'image.png'
splot 'ASCIIdata.txt' using 1:2:3 notitle with points palette ps 1 pt
5


0 new messages