0

我想用 gnuplot 在 c 中制作蜘蛛网图,但曲线绘制得不好。

这是代码。

#include <stdio.h>

int main(void){

int i, n=100; // Time

double r=3.80; // Initial condition of maximum rate of increase
double x[102]; // Increase rate
x[0]=0.7; // Initial condition

/*--- making data ---*/
for(i=0;i<=n;i++){
        x[i+1]=r*(1-x[i])*x[i];
        printf("%lf\t%lf\n",x[i],x[i+1]);
}

return 0;

}

绘制曲线

然后,plot "chaos2.plt" with line在 gnuplot 中。

我想从坐标绘制一个图表,但它是这样绘制的。如何修复代码?

预期图

4

0 回答 0