Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I have a data file created by an C++ Programm which creates the lines of the data file by an operation inside an loop

where the entries of the gsl_vector x are doubles and my_f(x,par) is a double depending on x.Code (C):data3dRnd << gsl_vector_get(x,0) << ' ' << gsl_vector_get(x,1) << ' ' << my_f(x,par) << endl << endl;

I would like to produce a colour plot with x1 and x2 on the axes and show my_f(x,par) via the color of plot. There are some points x where my_f(x,par) produces an Ignore value (1e+300 in this case) and I don't want data points to be plotted which lead to my_f = Ignore value.

In a 2D plot of my_f over sqrt(x1^2+x2^2) I achieve this withCode (Text):using 1:($2 < 1e+300 ? $2 : 1/0)

How can I achieve this? At first there was only one << endl in my code, but that gave me the error that i need more then one Isoline. So I entered the second << endl as the Isolines are sperated by a blank line.

My current Gnuplot Scrit is

This produces a grid with the correct ranges of x and y axes and a colour scale for my_f but with nothing in the plot window as shown in the attached pdf.Code (Text):set terminal eps enhanced

set output "VEffCont.eps"

set view map

set isosamples 100, 100

unset surface

set style data pm3d

set style function pm3d

set ticslevel 0

set title "Random v1 - v2 - Distribution"

set xlabel "v1 [GeV]"

set ylabel "v2 [GeV]"

set pm3d implicit at b

set palette cubehelix

splot "./3dRnd.dat" u 1:2:3 w pm3d

Thanks in advance.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Gnuplot: How to plot a 2d colorplot of a 3d function

Tags:

**Physics Forums | Science Articles, Homework Help, Discussion**