Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ethan A Merritt Newsgroups: comp.graphics.apps.gnuplot Subject: Re: heatmaps: splot matrix with image ? Date: Wed, 30 Jul 2014 22:30:49 -0700 Organization: made entirely of Lego Lines: 77 Message-ID: References: <460d0c80-5784-4ae1-b4a6-efaf7b9811f2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Thu, 31 Jul 2014 05:30:52 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="7bbfccb08e3cb0f92ebf95516f5f5a81"; logging-data="32374"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tnlLgm170OFmAHP52xgCR" User-Agent: KNode/4.11.4 Cancel-Lock: sha1:DpuLNwMOAUaAwGAPegY1dlDOoU0= Xref: csiph.com comp.graphics.apps.gnuplot:2543 Kalin Kozhuharov wrote: > 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 < 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)? I don't think that is possible in the current version. 5.0_rc2 will offer a new pair of keywords to handle exactly this case. > > This is a very simplified example (plotting Bulgarian flag), the real > data is about 100x100 matrix. > > $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" ??? In -rc2 the following script works. >> DOES NOT IN -rc1 << set xrange [] noextend set yrange [] noextend set palette defined (0 "#FFFFFF", 1 "#00966E", 2 "#D62612") plot $REAL matrix columnheaders rowheaders \ using (0.5+$1):(0.5+$2):3 with image Notes: - no quotes around $REAL - autoscaling and axis offset works better with "plot" than with "splot" - the rowheaders and columnheaders matrix keywords work essentially like the xticlabels and yticlabels option in regular plots. - see 4th plot in the on-line heatmaps demo for version 5.0 http://gnuplot.sourceforge.net/demo_cvs/heatmaps.html > I hope something doesn't eat the tabs in the file... Better to use commas for the purpose of an example :-) > Also, is there a way to add thin black border around each square? I can't think of an easy way to do that. > And finally, a way to avoid 0.5unit shift, so z(0,0) sits on 0,0, not > centered there? See plot command above. Ethan > Cheers, > Kalin.