#include<cmath>#include<matplot/matplot.h>intmain(){usingnamespacematplot;auto[X,Y]=meshgrid(iota(-3,.125,3));autoZ=peaks(X,Y);// the fence color will be the average Z in that rowvector_1dc;for(constauto&row:Z){c.emplace_back(mean(row));}fence(X,Y,Z,c);colorbar();show();return0;}