|
From: MartinOShea <ap...@ds...> - 2007-07-18 10:06:37
|
Hello I have a set of sample data as follows: CEMI (x) ggbs(y) FLOW MM (z) 0.0 90.0 0 6.5 58.7 166 6.6 59.0 169 7.3 65.0 141 6.1 54.5 162 8.5 76.2 217 7.1 64.2 174 6.0 54.2 209 7.0 63.0 198 7.6 68.3 171 which produces a simple set of points on a 3D graph using splot. However, what I would like is to do is to interpolate between points to calculate the coordinates for a flow contour of, for example, 175 mm? Can anyone advise how I might do this? Thanks Martin O'Shea. -- View this message in context: http://www.nabble.com/Contouring-in-GnuPlot-tf4102311.html#a11665821 Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: <pl...@pi...> - 2007-07-22 22:48:26
|
On Wed, 18 Jul 2007 12:06:29 +0200, MartinOShea <ap...@ds...> wrote: > > Hello > > I have a set of sample data as follows: > > CEMI (x) ggbs(y) FLOW MM (z) > > 0.0 90.0 0 > 6.5 58.7 166 > 6.6 59.0 169 > 7.3 65.0 141 > 6.1 54.5 162 > 8.5 76.2 217 > 7.1 64.2 174 > 6.0 54.2 209 > 7.0 63.0 198 > 7.6 68.3 171 > > which produces a simple set of points on a 3D graph using splot. However, > what I would like is to do is to interpolate between points to calculate > the > coordinates for a flow contour of, for example, 175 mm? > > Can anyone advise how I might do this? > > Thanks > > Martin O'Shea. This will almost certainly need to be done outside gnuplot by preprocessing the data. Catmull-Romm spline would probably be a good choice to interpolate your example contour at 175mm |
|
From: Theo H. <th...@ph...> - 2007-07-24 17:22:33
|
MartinOShea wrote: > Hello > > I have a set of sample data as follows: > > CEMI (x) ggbs(y) FLOW MM (z) > > 0.0 90.0 0 > 6.5 58.7 166 > 6.6 59.0 169 > 7.3 65.0 141 > 6.1 54.5 162 > 8.5 76.2 217 > 7.1 64.2 174 > 6.0 54.2 209 > 7.0 63.0 198 > 7.6 68.3 171 > > which produces a simple set of points on a 3D graph using splot. However, > what I would like is to do is to interpolate between points to calculate the > coordinates for a flow contour of, for example, 175 mm? > > Can anyone advise how I might do this? Contouring requires that the data be in grid format, i.e., with an equal number of 'y' values for every 'x' value. See `help grid_data` for details. You can use `set dgrid3d` to convert a non-gridded data set to gridded, but the results of the default algorithm are (to my sight) generally unsatisfactory. If you're willing to build gnuplot from source, there is an option to replace the default dgrid3d algorithm with a more sophisticated one that produces results which are (again, to my sight) more pleasing. Try './configure --enable-thin-splines'. In either case, once you've used `set dgrid3d` to produce an interpolated surface, this surface can be used to create contours. Since contours are a global setting, and not a per-dataset one, you'll likely want to use `set table` to output the contours to a file, then plot that file with your original data. THeo |
|
From: Paul <ps...@dr...> - 2007-07-31 21:35:14
|
> This will almost certainly need to be done outside gnuplot by > preprocessing the data. Catmull-Romm spline would probably be a good > choice to interpolate your example contour at 175mm Hello, Do you know of a good software application in linux which will do this preprocessing? |
|
From: <pl...@pi...> - 2007-08-01 18:37:40
|
On Tue, 31 Jul 2007 23:28:01 +0200, Paul <ps...@dr...> wrote: >> This will almost certainly need to be done outside gnuplot by >> preprocessing the data. Catmull-Romm spline would probably be a good >> choice to interpolate your example contour at 175mm > > Hello, > > Do you know of a good software application in linux which will do th= is > preprocessing? > > Sorry I dont recall your data. If it's regular in x,y intervals you coul= d = possibly try presenting it as a bitmap to gimp. I've toyed with this idea a couple of times but never done it. Your z coordinate would be the "colour" as a greyscale. You could then = scale up the image using "cubic" which uses catmull-rom algorithm. This = = would effectively interpolate without affecting your existing points as = = long as you use and integer multiple of the number of points. One word of warning, the splines tend to over shoot if the data has shar= p = changes in direction within the range of it's four anchors. Like any = interpolation, it is fiction. You need to insure that the results make = sense. If you cannot do it with gimp you could probably process your data using= = awk . The spline fit is very simple and fast to execute /* Catmull-Rom spline - not bad * basic intro http://www.mvps.org/directx/articles/catmull/ * This formula will calculate an interpolated point between pt1 and p= t2 * dx=3D0 returns pt1; dx=3D1 returns pt2 */ static inline gdouble cubic_spline_fit (gdouble dx, gint pt0, gint pt1, gint pt2, gint pt3) { return (gdouble) ((( ( - pt0 + 3 * pt1 - 3 * pt2 + pt3 ) * dx + ( 2 * pt0 - 5 * pt1 + 4 * pt2 - pt3 ) ) * dx + ( - pt0 + pt2 ) ) * dx + (pt1 + pt1) ) / 2.0; } This is cut from the Gimp GPL source code in /app/paint-funcs/scale-func= s.c Please let me know how you get on . I'm curious to know if the technique= = works. ;) > > > > ----------------------------------------------------------------------= --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser= . > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |