CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to get contour or surface plot form datafile (with gnuplot)?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2016, 06:43
Default How to get contour or surface plot form datafile (with gnuplot)?
  #1
New Member
 
Francesco L. Romeo
Join Date: Jun 2016
Location: Milan, Italy
Posts: 6
Rep Power: 9
FrancescoLRomeo is on a distinguished road
Send a message via Skype™ to FrancescoLRomeo
Hello,
I would like to use gnuplot to plot my 2d function ch(x,y) [generated by FreeFem++]. My datafile is structured in this way:

x1 y1 ch(x1,y1)
x2 x2 ch(x2,y2)
x3 y3 ch(x3,y3)
x1 y1 ch(x1,y1)

x4 y4 ch(x4,y4)
...
...
...

...

where I have the value of my function at the 3 vertices of every triangle which constitutes my (triangular, not structured) mesh (see figure here http://i65.tinypic.com/2mydkq9.jpg).
What I would like to get is two separate figures:
1. something like this for the surface, with a colorbar as a legend:
http://i68.tinypic.com/egvkzr.jpg
and
2. something like this for contour lines, with a colorbar as a legend:
http://i67.tinypic.com/msgepg.jpg

How can I get these two figures with gnuplot?
I've tried for example doing the first one :

set palette rgbformulae 33,13,10
set xrange [0: 0.25]
set yrange [0: 0.20]
set view map
splot "mydatafile.txt" w l pal

but the triangles inside are white (not filled with colors) and only the edges of the triangles are coloured.
How about the contour lines?

Thank you in advance,

Keccogrin
FrancescoLRomeo is offline   Reply With Quote

Reply

Tags
gnuplot


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Contour plot for omega_z ?? snehal OpenFOAM 3 March 11, 2017 05:41
How ot plot pressure over an object surface? vilius STAR-CCM+ 2 March 25, 2015 15:50
How to plot velocity and Mach contour on a blade surface in spanwise direction? Saima Tecplot 1 April 22, 2014 10:59
[OpenFOAM] Contour Plot with Paraview jet ParaView 0 August 26, 2010 10:30
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 19:41.