Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1659148
  • 博文数量: 230
  • 博客积分: 10045
  • 博客等级: 上将
  • 技术积分: 3357
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-30 20:40
文章分类

全部博文(230)

文章存档

2011年(7)

2010年(35)

2009年(62)

2008年(126)

我的朋友

分类:

2010-03-23 23:29:36

受的启发,稍微修改了一下,可以用gnuplot做动态的绘图。

gendata.cpp

#include <iostream>
#include <stdlib.h>
#include <cmath>
#include <windows.h>

using namespace std;

int main()
{
    for (double t=0;t<=100*M_PI;t+=M_PI/512.0)
    {
        cout<<"p [-1.5:1.5][-1.5:1.5] '-' ps 2"<<endl;
        cout<<sin(t)<<"\t"<<cos(t)<<endl<<'e'<<endl<<flush;
        Sleep(500);
    }
    return 0;
}


编译后生成gendata.exe

在命令行下运行 gendata | pgnuplot

注意:因为我用的是windows平台,最好还是使用pgnuplot,支持pipe好一些。
阅读(524) | 评论(0) | 转发(0) |
0

上一篇:use gnuplot(2)

下一篇:不稳定的sleep

给主人留下些什么吧!~~