[..] La fonction [shq] drawsurfaceshq
Code
int drawsurface_shq_xpl(){
scltracefa(§, ƒ, ∅);
scltracefc("scl-%s (%s) : %s\n\n", sclver(), sclsec(), temps_char(0));
int ierr = -1;
/*int setn=2, seti;*/
int setx[2] = { 10, 9 };
int rown=setx[0], rowi, coln=setx[1];
double **mat = (double **)newtabx(sizeof(double), 2, setx);
if (mat==∅){
scltracerr(§, ƒ, ∅, "mat allocation error!\n");
scltracefe(§, ƒ, ∅);
return ierr;
} ierr--;
for(rowi=0;rowi<rown;rowi++){
rand(coln, 103*rowi, 1, 10, mat[rowi]);
}
std::string jsoname=std::string(ƒ)+".json",
jsonpath="./srt/"+jsoname;
shq::beginDrawing(); // <Initializes the "connection"
shq::newFigure("drawsurface_shq"); // <Creates a new figure;
shq::drawSurface(rown, coln, mat, 0, 0, 1, 1, shq::Params("colormap","qhult"));
shq::axisAuto();
shq::axisEqual("drawsurface_shq");
/*shq::setFigureProperties("drawline_shq",
shaqParams("x",0,"y",220,"width",450,"height",100));*/
std::vector<std::string> labels;
labels.push_back("[dim-1]"); labels.push_back("[dim-2]"); labels.push_back("[dim-3]");
shq::axisLabels(labels);
shq::saveImage("./srt/drawsurface_shq.svg");
shq::endDrawing(); // <Closes the "connection"
scltracefe(§, ƒ, ∅);
return 0;
}
/* ƒ décorée par le 01-04-2024 14:36:04 */
Sortie
[>..\xpl\src\sclgraf.shq.xpl.cpp.drawsurface_shq_xpl]
scl-24.03 (gwin64) : 01-04-2024 14:36:04
[<..\xpl\src\sclgraf.shq.xpl.cpp.drawsurface_shq_xpl]