Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2542
| Newsgroups | comp.graphics.apps.gnuplot |
|---|---|
| Date | 2014-07-29 02:04 -0700 |
| Message-ID | <460d0c80-5784-4ae1-b4a6-efaf7b9811f2@googlegroups.com> (permalink) |
| Subject | heatmaps: splot matrix with image ? |
| From | Kalin Kozhuharov <me.kalin@gmail.com> |
Hello,
I have been playing with 5.0_rc1 and also trying to plot heatmaps.
Not sure if I got it right, please advise if there are better ways to do.
Here is a script that works fine (needs 5.0 for the <<EOD it seems), but how can I have non-numeric data labels for the matrix?
How can I plot $REAL (instead of $FAKE) or similar to that (the data to plot is dump from a DB in similar format)?
This is a very simplified example (plotting Bulgarian flag), the real data is about 100x100 matrix.
---------------------------------------------------------------
#!/usr/bin/gnuplot
reset;
set datafile separator "\t";
$FAKE << EOD
3 0 1 2
0 2 2 2
1 1 1 1
2 0 0 0
EOD
$REAL << EOD
3 a b c
A 2 2 2
B 1 1 1
C 0 0 0
EOD
unset key; unset colorbox; unset xtics; unset ytics;
set xrange [-0.5:2.5]; set yrange [-0.5:2.5];
set palette defined (0 "#FFFFFF", 1 "#00966E", 2 "#D62612");
set view map;
set xtics nomirror out ("A" 0, "B" 1, "C" 2);
set ytics nomirror out ("a" 0, "b" 1, "c" 2);
splot "$FAKE" nonuniform matrix using 1:2:3 with image;
#splot "$REAL" ???
---------------------------------------------------------------
I hope something doesn't eat the tabs in the file...
Also, is there a way to add thin black border around each square?
And finally, a way to avoid 0.5unit shift, so z(0,0) sits on 0,0, not centered there?
Cheers,
Kalin.
Back to comp.graphics.apps.gnuplot | Previous | Next — Next in thread | Find similar | Unroll thread
heatmaps: splot matrix with image ? Kalin Kozhuharov <me.kalin@gmail.com> - 2014-07-29 02:04 -0700
Re: heatmaps: splot matrix with image ? Ethan A Merritt <EAMerritt@gmail.com> - 2014-07-30 22:30 -0700
Re: heatmaps: splot matrix with image ? Kalin Kozhuharov <me.kalin@gmail.com> - 2014-08-19 11:41 -0700
csiph-web