static void quit(
void *wid, gpointer data) {
gtk_main_quit();
}
#define cnt 101
#include <time.h>
#include <math.h>
#define TYPE float
string text("test this");
float textX, textY;
gboolean sinusoid(gpointer user_data){
int s=time(NULL);
int maxY=-1;
for (int i=0;i<cnt;i++){
y[i]=100.0*sin((TYPE)i/((TYPE)cnt-1)*2*M_PI+s);
textX=(float)i;
}
}
textY=160.;
p[0]->
text(&textX, &textY, text.c_str(),
"k");
p[1]->
text(&textX, &textY, text.c_str(),
"k");
return 1;
}
}
int main(
int argc,
char *argv[]) {
gtk_init( &argc, &argv );
gtk_widget_set_size_request (topWindow.
getWidget(), 1000, 500);
TYPE x1[cnt], y1[cnt];
for (int i=1;i<cnt;i++)
for (int i=1;i<cnt;i++){
x1[i]=(TYPE)i;
y1[i]=(TYPE)i+100.0;
}
setupCustomColours(cls);
cls=(char*)"b2";
figure.
plot(x1,y1,cnt, cls);
figure.
limits(1.0,101.0,1.0,201.0);
figure.
set(figure.
gca(),
"XLabelFormat",
"%%.1f", NULL);
figure.
title(
"Figure 1");
figure.
xLabel(
"first plot x label");
figure.
yLabel(
"just an example y");
cls=(char*)"r";
figure2.
plot(
x,
y,y1,cnt, cls);
figure2.
limits(1.0,101.0,1.0,201.0);
figure2.
title(
"Figure 2");
figure2.
xLabel(
"second plot x label");