cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 3465|回复: 9

【请教】用strip chart控件做曲线出现的问题

[复制链接]
发表于 2006-3-8 22:56:12 | 显示全部楼层 |阅读模式
在用strip chart作图是出现了问题,麻烦高手看一下,我是按3Hz计算的正弦曲线,可是感觉strip chart同时给我花了两个正弦,变成了6Hz的曲线,中间的连接部分还出现如图所示的情况,请问这事怎么回事?该如何解决?还请各位执教!<img src="attachments/dvbbs/2006-3/20063814553181399.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(\'attachments/dvbbs/2006-3/20063814553181399.jpg\');}" onmousewheel="return imgzoom(this);" alt="" />

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2006-3-17 18:53:43 | 显示全部楼层
因为你的数据只有这么多,所以它就只能显示这么多了!如果你画了一次,显示二条曲线真的挺奇怪的,把你的程序再复制出来瞧瞧!或者你重新建一个项目,再做一次,或者有什么地方不小心弄错了呢?我用过另一个按点画的函数!
发表于 2006-3-9 06:01:35 | 显示全部楼层
<>兄弟最好能把C程序复制一部分贴出来,这样可能更容易查问题出来!</P>[em08]
 楼主| 发表于 2006-3-9 17:37:36 | 显示全部楼层
<>代码如下,麻烦哥们看一下。</P>
<>int n,frequency=3,force=50;</P>
<>for(n=0;n&lt;100;n++)<BR>{indata[n]=force*sin(2.0*PI*frequency*n/100);<BR>sampledata[n]=force*sin(2.0*PI*frequency*(n-2)/100);}</P>
<P>float temp1,temp2;<BR>temp1=indata[99];</P>
<P>temp2=sampledata[99]; </P>

<P>    for(n=99;n&gt;0;n--)<BR>    {<BR>  temp=indata[n];<BR>  indata[n]=indata[n-1];<BR>  sampledata[n]=sampledata[n-1];<BR>    }</P>
<P>  ClearStripChart(ForceTestPanelHandle,ForceTest_STRIPCHART_2);<BR>     PlotStripChart(ForceTestPanelHandle,ForceTest_STRIPCHART_2,indata,100,0,0,VAL_FLOAT);<BR>     PlotStripChart(ForceTestPanelHandle,ForceTest_STRIPCHART_2,sampledata,100,0,0,VAL_FLOAT);</P>
发表于 2006-3-14 06:37:51 | 显示全部楼层
发表于 2006-3-11 08:12:45 | 显示全部楼层
<> PlotStripChart(ForceTestPanelHandle,ForceTest_STRIPCHART_2,indata,100,0,0,VAL_FLOAT);<BR>     PlotStripChart(ForceTestPanelHandle,ForceTest_STRIPCHART_2,sampledata,100,0,0,VAL_FLOAT);</P>
<>这里可是画了二次了呀兄弟?</P>
 楼主| 发表于 2006-3-17 17:03:39 | 显示全部楼层
<>多谢,不过我还不是很清楚,我那个是画两组数据,也就是两条曲线,不是应该两次调用plotstripchart吗?现在注释掉一条语句,却画了两条曲线,但是只在屏幕的一半显示,为什么不是满屏幕显示呢?还请老大详细说一下,有没有这方面的例程,麻烦借看一下。</P><img src="attachments/dvbbs/2006-3/2006317962144802.jpg" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(\'attachments/dvbbs/2006-3/2006317962144802.jpg\');}" onmousewheel="return imgzoom(this);" alt="" />
[此贴子已经被作者于2006-3-17 9:06:30编辑过]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2006-3-29 03:34:29 | 显示全部楼层
<>想在一个图里画出两条曲线来,是用PlotXY函数吧</P>
<>看帮助了。</P>
发表于 2006-4-24 17:54:21 | 显示全部楼层
<>你的控件设置有问题,设了两条曲线</P>
<>所以你用以下语句时</P>
<>PlotStripChart(ForceTestPanelHandle,ForceTest_STRIPCHART_2,indata,100,0,0,VAL_FLOAT);</P>
<P>每次给控件每条曲线传递一组数据,方式如下:</P>
<P>数据为:1 2 3 4 5 6 7 8 9 0</P>
<P>第一条为:1 3 5 7 9</P>
<P>第二条为:2 4 6 8 0 </P>
发表于 2008-7-4 07:32:27 | 显示全部楼层
楼上的意思是说,如果控件设置的时候设置成2的话,两条曲线是隔点取来画图的吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-5-4 12:42 , Processed in 0.571132 second(s), 9 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表