- Curriculum vitae
- Publications
- CFD
- Numerical methods for dense gas-particle flows
- CFD codes for multiphase flow applications
- Quadrature-based uncertainty quantification
- Frictional models for dense gas-particle flows
- Large eddy simulation models
- Quadrature-based moment methods for gas-particle flows
- Tools for quadrature-based methods
- GeekoCFD
- Contacts
- About
albertopassalacqua.com












I saw your long posting regarding Gnuplot, and thought you might be interested to know that there is now a book on it: “Gnuplot in Action”. You can pre-order it directly from the publisher: Manning: Gnuplot in Action.
The book includes chapters on multi-dimensional plotting and color management, including recommendations for optimal palette design for data visualization.
If you want to learn more about the book and the author, check out my book page at Principal Value – Gnuplot in Action.
Let me know if you are interested in a review copy.
yes, gnuplot is a great tool, and I think there are only few publications in which you can no find some plots generated with this excelent soft.
Well this is all great but what you are using is called color maps, not contour plots. Notice that with pm3d you are not in fact making any isolines, just plotting the color corresponding to the values at a given point. For actual contour plots, use “set contour” in gnuplot, with all the corresponding options. Not that the maps are way more convenient than the contours.
Thanks Jarko. Someone calls them “filled contours” too though.
Hi Alberto
I have tried to replicate your example but am getting a warning “skipping unreadable file” and the plotting area is blank. Am i missing something in my input data file? It looks like this (see below gnuplot instructions and data): (x, y and z and ordered in rows with a space after each row and a line breaker at the end of each line)
Thanks a lot
Gerardo
set title ‘plot test’
set pm3d map
set xrange [0:10000]
set yrange [0:-1800]
set zrange [150000:17598000]
set cbrange [150000:17598000]
set palette rgbformulae 22,13,10
splot ‘test.txt’
1.25E+01 -5.00E+00 1.50E+05
4.25E+01 -5.00E+00 1.50E+05
8.45E+01 -5.00E+00 1.50E+05
1.43E+02 -5.00E+00 1.50E+05
2.26E+02 -5.00E+00 1.50E+05
3.41E+02 -5.00E+00 1.50E+05
5.02E+02 -5.00E+00 1.50E+05
7.28E+02 -5.00E+00 1.50E+05
1.04E+03 -5.00E+00 1.50E+05
1.49E+03 -5.00E+00 1.50E+05
2.11E+03 -5.00E+00 1.50E+05
2.97E+03 -5.00E+00 1.50E+05
4.19E+03 -5.00E+00 1.50E+05
5.89E+03 -5.00E+00 1.50E+05
8.43E+03 -5.00E+00 1.50E+05
9.99E+03 -5.00E+00 1.50E+05
1.25E+01 -3.00E+01 4.51E+05
4.25E+01 -3.00E+01 4.59E+05
8.45E+01 -3.00E+01 4.64E+05
1.43E+02 -3.00E+01 4.62E+05
2.26E+02 -3.00E+01 4.55E+05
3.41E+02 -3.00E+01 4.47E+05
5.02E+02 -3.00E+01 4.39E+05
7.28E+02 -3.00E+01 4.31E+05
1.04E+03 -3.00E+01 4.23E+05
1.49E+03 -3.00E+01 4.13E+05
2.11E+03 -3.00E+01 4.05E+05
2.97E+03 -3.00E+01 3.99E+05
4.19E+03 -3.00E+01 3.96E+05
5.89E+03 -3.00E+01 3.96E+05
8.43E+03 -3.00E+01 3.96E+05
9.99E+03 -3.00E+01 3.96E+05
Comment edited to remove the long set of data.
Hello. I actually obtain a color map without errors from your file using gnuplot 4.2 patchlevel 5, but it looks like gnuplot cannot interpret the data correctly, since the image is distorted on its left-hand side.
I used the version 4.4 rc, so am gonna try with 4.2.5 or 4.2.6 then. Any clue why this could be happening or advise on what else to try? Thanks.
Hello, unfortunately I do not know why it’s behaving differently. Sorry about that.
When I run a sample contour chart in Excel and in DeltaGraph, I get a different look than I do with the false color map in gnuplot. The Excel and DeltaGraph charts have very straight, angled edges, which my client prefers. The gnuplot chart is in squarish blocks. Is it possible to avoid this squarish blocky look, and to get this look that we find in Excel and Deltagraph charts, with a gnuplot false color or contour chart?
Link to Excel sample chart:
http://www.market-research-services.com/Temporary/Excel-sample.jpg
Link to DeltaGraph sample chart:
http://www.market-research-services.com/Temporary/DeltaGraph-sample.jpg
Link to Gnuplot sample chart:
http://www.market-research-services.com/Temporary/gnuplot-sample.jpg
Link to datafile:
http://www.market-research-services.com/Temporary/dataFileKey_30
Thanks very much in advance for any info.
Best,
-Vik
gnuplot commands:
unset surface
unset key
set view map
set pm3d
set palette defined (0 ‘black’, 2 ‘gray50′, 3 ‘dark-blue’, 8.43243243243 ‘dark-green’, 18.972972973 ‘light-green’, 20.5263157895 ‘#dac000′, 30.7894736842 ‘#fee000′, 32.8421052632 ‘#ff8000′, 55.4210526316 ‘#ff5a00′, 66.7105263158 ‘orange-red’, 78 ‘dark-red’)
set output ‘/Applications/Heatmaps/htdocs/ftp/Heatmaps/heatMap_key30.jpg’
set term jpeg size 600, 600 enhanced font ‘/Library/Fonts/arial.ttf’ 8
set dgrid3d 400,400 gauss 0.35,0.35
set size square
set xtics(“” 1, “Day 0″ 2, “2-7\ndays” 3, “2\nWeeks” 4, “3\nWeeks” 5, “1\nMonth” 6, “2-3\nMonths” 7, “4-6\nMonths” 8, “7-12\nMonths” 9, “1 Year+” 10 )
set title ‘{/=18 Chart Title}’ offset 0, .5
set ylabel ‘{/=16 Degree of Influence}’ offset -1.6, 0
set xlabel ‘{/=16 Days from Purchase}’ offset 0,-1.6
set xtics out nomirror
set ytics out nomirror
set ytics(“” 0, “1″ 1, “2″ 2, “3″ 3, “4″ 4, “5″ 5, “6″ 6, “7″ 7, “8″ 8, “9″ 9, “10″ 10, “” 11)
set y2tics(“” 0, “1″ 1, “2″ 2, “3″ 3, “4″ 4, “5″ 5, “6″ 6, “7″ 7, “8″ 8, “9″ 9, “10″ 10, “” 11)
set xrange [0:11] reverse
set yrange [0:11]
splot [1:] ‘/Applications/Heatmaps/htdocs/ftp/Heatmaps/dataFileKey_30′ matrix
replot
P.S. – Here is a link to a data file such as the one you describe, and a contour map command set such as the one you describe.
Link to contour datafile:
http://www.market-research-services.com/Temporary/dataFileKey_30_contour
Contour data commands:
set size square
unset title
set pm3d map
set xrange [0:10]
set yrange [0:11]
set format x “”
set format y “”
set cbrange [0:115]
set palette defined (0 ‘black’, 2 ‘gray50′, 3 ‘dark-blue’, 8.43243243243 ‘dark-green’, 18.972972973 ‘light-green’, 20.5263157895 ‘#dac000′, 30.7894736842 ‘#fee000′, 32.8421052632 ‘#ff8000′, 55.4210526316 ‘#ff5a00′, 66.7105263158 ‘orange-red’, 78 ‘dark-red’)
splot ‘/Applications/htdocs/ftp/Heatmaps/dataFileKey_30_contour’
set term jpeg size 600, 600 enhanced font ‘/Library/Fonts/arial.ttf’ 8
set output ‘/Applications/htdocs/ftp/Heatmaps/heatMap_key30_2.jpg’
replot
Hi
This is a long shot. I started using Gnuplot as I was told it can do contour plots very easily. I am learning by trial and error. One of the thing I would like to do is a contour plots on a circular region but it seems that it can only do rectangular plot. I’d like to do contour plots on a circle, just like a wind turbine or rotor, regularly. I don’t seem to be able to confine the grid within the circle even I ensure my dimension goes from -1 to 1 on both x and y-axes. can you help?
I would recommend you to save your data in a format readable by tools like paraview (VTK for example). It will be much easier to post-process them, if the geometry is complex.