Issues in gnuplot: pm3d and dgrid3d

In summary, The speaker is using gnuplot to plot 3D data generated by a fortran program. They are experiencing a problem when using the pm3d and dgrid3d functions, resulting in a "sliced" surface instead of a smooth one. They have solved the problem by dividing the x-values by 1 million, but are unsure if this is a bug with the pm3d function. They thank anyone who read their post.
  • #1
abonatto
14
0
Dear All,

I am using gnuplot to make plots from data files generated using a fortran program. Those data files are basically big lists of 3d coordinates, just like like (not my real data, just an example):

10.0 1.00 0.01
20.0 1.00 0.14
...

So, when I use splot, I generate plot 1 (attached), and it is ok. But, after that, when I use pm3d ("set pm3d") and dgrid3d ("set dgrid3d 64,64,1", for example), it plots plot 2 (attached), which is pretty different from B]plot 1[/B]: the surface generated is "sliced", and it is not a continuous and smooth surface that it should be.

I have tried to plot with higher values in dgrid3d (256,256,3 and others...), but the problem still happens).

I really would appreciate any help on this :-)

Alexandre
 

Attachments

  • plot 1.png
    plot 1.png
    33.4 KB · Views: 807
  • plot 2.png
    plot 2.png
    15.3 KB · Views: 916
Physics news on Phys.org
  • #2
Dear All,

Its me again! I have "solved" the problem, and I will post here what I did (I hope it helps someone someday :)

All I did was to divide the x-values (0 to 2.5e+06; look in plot 2 attached in the previous post) for 1e+06 (in gnuplot I changed column 1 for "($1/1000000)": please see in plot 3, attached in this post, that x-values now are between 0 and 2.5). Now I got a continuous and smooth surface, just as I was expecting to see (based on plot 1 grid of points). Would this be a bug with pm3d function in gnuplot?

Thanks to everybody who read this post!
 

Attachments

  • Plot 3.png
    Plot 3.png
    24.7 KB · Views: 914

Related to Issues in gnuplot: pm3d and dgrid3d

1. What is the difference between pm3d and dgrid3d in gnuplot?

PM3D is a plotting style in gnuplot that produces colored surfaces based on the values of a third data column. Dgrid3d, on the other hand, is a command that interpolates data points to create a smooth surface for plotting. Essentially, pm3d is a plotting style while dgrid3d is a command that can be used to enhance a plot.

2. Can pm3d and dgrid3d be used together in gnuplot?

Yes, pm3d and dgrid3d can be used together to produce high-quality plots. The dgrid3d command can be used to interpolate data points for pm3d to create a smoother surface, resulting in a more visually appealing plot.

3. How do I customize the color palette for pm3d plots in gnuplot?

The color palette for pm3d plots can be customized by using the "set palette" command. This allows you to specify the colors and ranges for each color in the palette. You can also use predefined palettes or create your own using a color mapping function.

4. Can I use pm3d and dgrid3d to plot 3D data in gnuplot?

Yes, pm3d and dgrid3d are both useful tools for plotting 3D data in gnuplot. Pm3d can be used to create a surface plot, while dgrid3d can be used to enhance the plot by interpolating data points. Together, they can produce a more accurate and visually appealing plot of 3D data.

5. Are there any limitations to using pm3d and dgrid3d in gnuplot?

One limitation of using pm3d and dgrid3d is that they can only be used to plot data with three columns. This means that they cannot be used for multi-dimensional data sets. Additionally, dgrid3d may not always produce accurate results if the data is not evenly distributed. In these cases, other interpolation methods may be more suitable.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
76
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Programming and Computer Science
Replies
4
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
7K
Back
Top