gnuplot 3D: How do I emphasize z-values along a constant x- (or y-) value line?

27 views Asked by At

I have a 3D-surface using the command
splot '-' nonuniform matrix using 1:2:3 with lines palette
I know that I can emphasize certain z-value levels with contour. But I want to do that with x- and y-values. Ie have a line of all (x,y,z) with the same x- (or y-) value plotted in a different color or other linewidth. If anyhow possible I don't want to extract the values from the data and plot a new curve, especially the precise x- and y- value may not be in the data. Thanks a lot. Update: source and picture I control gnuplot from a C++ program through a pipe. Here are the corresponding control commands:

  fprintf (gnuplotPipe, "set terminal windows\n");
  fprintf (gnuplotPipe, "set hidden3d\n");
  fprintf (gnuplotPipe, "set title '3D Surface'\n");
  fprintf (gnuplotPipe, "set zrange [0:100]\n");
  fprintf (gnuplotPipe, "set xyplane  at 0\n");
  fprintf (gnuplotPipe, "unset key\n");  // hide the key
  fprintf (gnuplotPipe, "splot '-' nonuniform matrix using 1:2:3  with lines\n");
  fprintf (gnuplotPipe, "\n");

After that I send this array that is a gnuplot nonunioform matrix:

constexpr int32_t surface [y_size + 1][x_size + 1] = {
  {  20,  0, 216, 431, 647, 862, 1078, 1293, 1509, 1724, 1940, 2155, 2371, 2586, 2802, 3017, 3233, 3448, 3664, 3879, 4095},
//    0   1    2    3    4    5     6     7     8     9    10    11  12  13  14  15  16  17  18  19  20
  {   0, 89,  90,  90,  90,  90,   90,   90,   90,   90,   90,   90, 90, 90, 90, 90, 90, 90, 90, 89, 89},
  { 216, 90,  90,  90,  90,  90,   90,   90,   90,   90,   90,   90, 90, 90, 90, 90, 90, 90, 89, 89, 89},
  { 431, 90,  90,  90,  90,  90,   90,   90,   90,   90,   90,   89, 89, 89, 89, 89, 89, 89, 89, 89, 89},
  { 647, 90,  90,  90,  90,  90,   90,   90,   89,   89,   89,   88, 88, 88, 87, 87, 87, 87, 86, 86, 87},
  { 862, 90,  90,  90,  90,  90,   89,   89,   88,   88,   87,   86, 85, 85, 84, 84, 83, 83, 82, 82, 82},
  {1078, 90,  90,  90,  90,  89,   89,   88,   87,   86,   84,   83, 81, 80, 79, 78, 77, 76, 76, 76, 76},
  {1293, 90,  90,  90,  90,  89,   88,   87,   85,   83,   81,   79, 76, 74, 72, 70, 68, 67, 67, 67, 67},
  {1509, 90,  90,  89,  89,  88,   87,   85,   83,   81,   77,   74, 70, 66, 63, 61, 59, 58, 58, 59, 60},
  {1724, 90,  90,  90,  89,  88,   86,   84,   82,   78,   74,   70, 65, 60, 56, 51, 47, 45, 47, 50, 54},
  {1940, 89,  89,  89,  89,  87,   86,   83,   80,   76,   71,   66, 61, 56, 49, 38, 17, 24, 39, 47, 52},
  {2155, 89,  89,  89,  89,  87,   85,   83,   79,   75,   70,   65, 60, 55, 48, 41, 38, 42, 48, 52, 56},
  {2371, 89,  89,  89,  88,  87,   85,   82,   79,   74,   70,   65, 60, 56, 53, 51, 51, 53, 56, 58, 61},
  {2586, 89,  89,  89,  88,  87,   85,   82,   79,   75,   70,   66, 63, 60, 58, 58, 58, 59, 61, 63, 65},
  {2802, 89,  89,  89,  88,  86,   84,   82,   79,   75,   71,   68, 65, 63, 62, 62, 63, 64, 65, 67, 68},
  {3017, 89,  89,  89,  88,  86,   84,   82,   79,   76,   73,   70, 68, 67, 66, 66, 67, 68, 69, 70, 72},
  {3233, 89,  89,  89,  88,  86,   84,   82,   80,   77,   74,   72, 70, 69, 69, 69, 70, 71, 72, 73, 74},
  {3448, 89,  89,  89,  88,  86,   85,   83,   80,   78,   76,   74, 73, 72, 72, 72, 73, 74, 74, 76, 76},
  {3664, 89,  89,  88,  88,  86,   85,   83,   81,   79,   77,   75, 75, 74, 74, 74, 75, 76, 77, 77, 78},
  {3879, 89,  89,  89,  88,  86,   85,   83,   81,   80,   78,   77, 76, 76, 76, 76, 77, 78, 78, 79, 80},
  {4095, 89,  89,  88,  88,  86,   85,   83,   82,   80,   79,   78, 78, 78, 78, 78, 78, 79, 80, 80, 81},
};

And I get this picture:

enter image description here

I would like to get a line on the surface for x = 2000 and one for y = 2000. For both there are no values in the array.

0

There are 0 answers