write_gnuplot in a format that can be plotted as a contour plot

526 views
Skip to first unread message

Katie Leonard

unread,
May 9, 2013, 10:10:18 AM5/9/13
to dea...@googlegroups.com
Hi,

I was wondering if anyone can help!  I have used deal.II to produce a "output.gpl" file which I want to produce contour plots in gnuplot.  I can do surface plots no problem, but I have tried without success to produce a contour plot as I keep getting the message:

warning: Cannot contour non grid data. Please use "set dgrid3d".

But using "dgrid3d" didn't seem to help as I then get the error message:

"Gridding of the color column is not implemented"

I have searched on the gnuplot documentation to no avail  I don't suppose anyone has managed to do this previously, or know hows to convert the write_gnuplot output from deal.II to a grid data format?  Would be really grateful of any help!

Many Thanks,

Katie

Wolfgang Bangerth

unread,
May 9, 2013, 12:22:36 PM5/9/13
to dea...@googlegroups.com, Katie Leonard

> I was wondering if anyone can help! I have used deal.II to produce a
> "output.gpl" file which I want to produce contour plots in gnuplot. I can do
> surface plots no problem, but I have tried without success to produce a
> contour plot as I keep getting the message:
>
> warning: Cannot contour non grid data. Please use "set dgrid3d".
>
> But using "dgrid3d" didn't seem to help as I then get the error message:

I use
set contour
and it works. Or at least I used to do that many years ago when I still used
gnuplot.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Katie Leonard

unread,
May 9, 2013, 12:30:01 PM5/9/13
to Wolfgang Bangerth, dea...@googlegroups.com
Hi Wolfgang,

Thank you very much for your reply.  I was using "set contour base" but also just tried "set contour" and this still produces some weird results.  There are lots of lines .... the colours just have no association to the magnitude of the solution and it uses the same colour for different contours and complains that its "non grid data".  Perhaps I should try an older version of gnuplot.... hmmmm

Thanks anyway,

Katie

Wolfgang Bangerth

unread,
May 9, 2013, 12:34:04 PM5/9/13
to dea...@googlegroups.com, Katie Leonard
On 05/09/2013 11:30 AM, Katie Leonard wrote:
> Hi Wolfgang,
>
> Thank you very much for your reply. I was using "set contour base" but also
> just tried "set contour" and this still produces some weird results. There
> are lots of lines .... the colours just have no association to the magnitude
> of the solution and it uses the same colour for different contours and
> complains that its "non grid data". Perhaps I should try an older version of
> gnuplot.... hmmmm

You probably get one set of lines for each cell (due to the way we write
output files). But you can get one set of global contour levels by using
set cntrp lev disc ...
(see help cntrparam) to choose the levels of the contour lines.

Jose Javier Muñoz Criollo

unread,
May 9, 2013, 12:35:52 PM5/9/13
to dea...@googlegroups.com
I think the problem is how the data is sorted in the output data. Gnuplot expects something like:

....

3        15        18.6
3        30        58.6
3        45        108
3        60        116

6        15        22.4
6        30        43.3
6        45        63
6        60        53.8

9        15        16.6
9        30        30.6
9        45        38.3
9        60        57.2

....

and if you check your output file you will find something different. You could try to write an script to reorder the entries in the output file to match gnuplot format.

javier


2013/5/9 Katie Leonard <katiekat...@gmail.com>
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
José Javier Muñoz Criollo
PhD Student | Cardiff University School of Engineering
E-mail: josejm...@gmail.com

Katie Leonard

unread,
May 9, 2013, 1:47:34 PM5/9/13
to dea...@googlegroups.com
Thanks Wolfgang and Jose,

Using the "set cntrparam levels discrete ....." does help - although there still seems to be a problem with the fact that I can get multiple colours for each contour... I've tried to get around this by manually setting the colour for each contour but as yet not had much luck (would like the different contours to be different colours.... so far can only get them all one colour or each contour multicolorued!)

I have tried reordering the data, but I think the problem with this may be that my grid is not a rectangle, and so the structure of the data isn't regular, i.e. blocks of 4x3  as in your example, so gnuplot still complains!

Thanks anyway - I will continue trying but may also investigate other graphical packages that are slightly easier!

Katie

Wolfgang Bangerth

unread,
May 9, 2013, 2:03:03 PM5/9/13
to dea...@googlegroups.com

> Thanks anyway - I will continue trying but may also investigate other
> graphical packages that are slightly easier!

http://www.math.tamu.edu/~bangerth/videos.676.11.html
Reply all
Reply to author
Forward
0 new messages