如何在gnuplot中绘制蜘蛛网

时间:2018-10-06 09:58:13

标签: c gnuplot chaos

我想用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;

}

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

我想从坐标上绘制图形,但是这样绘制。 如何修复代码?

expected graph

0 个答案:

没有答案