新手求助,关于Gnuplot作图

OOo,TeX,KO,ABI,GIMP,Picasa,ProE,QCAD,Inkscape,Kicad,Eagle
回复
头像
tomcat.xin
帖子: 400
注册时间: 2007-02-08 21:18

新手求助,关于Gnuplot作图

#1

帖子 tomcat.xin » 2009-10-28 15:44

我的数据文件结构如下:
1,xxx,xxx,xxx
2,xxx,xxx,xxx
3,xxx,xxx,xxx
4,xxx,xxx,xxx
5,xxx,xxx,xxx
.....
共50000行
现在想以第一列的对数值为横坐标,第二列为纵坐标作散点图或者曲线图

我该如何操作呢?
越详细,越好,
谢谢
我是极新的新手
头像
the_comer
帖子: 264
注册时间: 2009-07-08 17:33

Re: 新手求助,关于Gnuplot作图

#2

帖子 the_comer » 2009-10-28 15:53

如果是2维坐标的话。
画图直接plot "文件名" 就行。但是如果是3列的话,还不知道怎么办。。
如果要对数据进行处理使用的话,后面接using .....不过俺从来没用过。。。 :em06 靠你自己看帮助了。。
头像
tomcat.xin
帖子: 400
注册时间: 2007-02-08 21:18

Re: 新手求助,关于Gnuplot作图

#3

帖子 tomcat.xin » 2009-10-28 16:00

the_comer 写了:如果是2维坐标的话。
画图直接plot "文件名" 就行。但是如果是3列的话,还不知道怎么办。。
如果要对数据进行处理使用的话,后面接using .....不过俺从来没用过。。。 :em06 靠你自己看帮助了。。
是二维的,但是文件里有很多列呀,如何指定特定的列
我知道matlab里可以这样做
plot(log10(xx(:,1)),x(:,2),'r.')
能麻烦你说细点么?谢谢
gnuplot的帮助看的一头雾水
头像
the_comer
帖子: 264
注册时间: 2009-07-08 17:33

Re: 新手求助,关于Gnuplot作图

#4

帖子 the_comer » 2009-10-28 16:15

:em06 我也不会。。。
我画图的时候是每次都只有两列。。。
反正画文件里面的点是的命令是plot "文件名"
:em06
dynamic0603
帖子: 259
注册时间: 2008-11-14 20:35

Re: 新手求助,关于Gnuplot作图

#5

帖子 dynamic0603 » 2009-10-28 18:12

plot datafile using 1:2
这是以第一列为横坐标,第二列为纵坐标。至于如何去对数,就不知了。
头像
guang5678
帖子: 248
注册时间: 2006-08-29 9:05
来自: HIT
联系:

Re: 新手求助,关于Gnuplot作图

#6

帖子 guang5678 » 2009-10-29 9:24

Gnuplot虽然很强大,但没有图形界面让我很没办法。
简单的图可以用Labplot,凑合着用。

ps:我经常到windows下用original画,方便实用,大家都说好。实在没办法。
:em04
头像
tomcat.xin
帖子: 400
注册时间: 2007-02-08 21:18

Re: 新手求助,关于Gnuplot作图

#7

帖子 tomcat.xin » 2009-10-29 17:26

guang5678 写了:Gnuplot虽然很强大,但没有图形界面让我很没办法。
简单的图可以用Labplot,凑合着用。

ps:我经常到windows下用original画,方便实用,大家都说好。实在没办法。
:em04
我的用来作图的数据巨大,有200m,original和labplot肯定都吃不消
头像
tomcat.xin
帖子: 400
注册时间: 2007-02-08 21:18

Re: 新手求助,关于Gnuplot作图

#8

帖子 tomcat.xin » 2009-10-29 19:49

dynamic0603 写了:plot datafile using 1:2
这是以第一列为横坐标,第二列为纵坐标。至于如何去对数,就不知了。
谢谢
如果数据是用空格分开的,可以用你的法子
我的数据是用逗号分开的,用你的法子不行呀
谢谢
逗号分开的怎么办呢?
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 新手求助,关于Gnuplot作图

#9

帖子 xiooli » 2009-10-29 20:05

tomcat.xin 写了:
dynamic0603 写了:plot datafile using 1:2
这是以第一列为横坐标,第二列为纵坐标。至于如何去对数,就不知了。
谢谢
如果数据是用空格分开的,可以用你的法子
我的数据是用逗号分开的,用你的法子不行呀
谢谢
逗号分开的怎么办呢?
可以先处理一下:

代码: 全选

tr "," " " < data > newdata
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 新手求助,关于Gnuplot作图

#10

帖子 eexpress » 2009-10-29 20:08

建议在gnuplot的cli里面,看帮助。
● 鸣学
头像
tomcat.xin
帖子: 400
注册时间: 2007-02-08 21:18

Re: 新手求助,关于Gnuplot作图

#11

帖子 tomcat.xin » 2009-10-29 20:13

找到了
要这样
set datafile separator ','
就好了,谢谢大家哈

help datafile separator
help using
头像
Ur@nus
帖子: 622
注册时间: 2006-12-01 23:02

Re: 新手求助,关于Gnuplot作图

#12

帖子 Ur@nus » 2009-10-29 22:00

以file.dat文件中的第一行和第二行为x,y,并且画线
plot 'file.dat' using 1:2 with line
以file.dat文件中的第一行和第二行为x,y,并且对y求对数。画点
plot 'file.dat' suing 1:(log10($2)) with point
头像
tomcat.xin
帖子: 400
注册时间: 2007-02-08 21:18

Re: 新手求助,关于Gnuplot作图

#13

帖子 tomcat.xin » 2009-10-30 10:36

现在有了新问题
如何在一个图上显示不同的图呢?
如:已经用数据文件a作了a图
现在用数据文件b作b图
想让b图和a图显示在一个图片上,如何操作呢?
在matlab里是用
hold on
但是gnuplot里没有hold on呀

帮助文件里还没找到
谢谢

这个也想明白了
可以在一行写不同的文件名及数据就行了
上次由 tomcat.xin 在 2009-10-30 16:21,总共编辑 1 次。
头像
the_comer
帖子: 264
注册时间: 2009-07-08 17:33

Re: 新手求助,关于Gnuplot作图

#14

帖子 the_comer » 2009-10-30 15:12

不同的图直接plot "文件1"..... , "文件2"就行
回复