01-12-2010 06:43 AM
Hi
I'm using a scattergraph in VB.Net with a noisy XY dataset that has a guassian(ish) peak in it, I want to draw an XYCursor with the Xposition at the max of this peak and the Y at the Half max value for the Y data - this is easy.
However I want to set the length of the horizontal crosshair to be the width of the half max (i.e. showing the FWHM).
I understand that I need to set the HorizontalCrosshairMode = CursorCrosshairMode.Custom however I cannot understand how the HorizontalCrosshairLength relates to my X dataset, the help file is really helpful here!
Graeme
Solved! Go to Solution.
01-14-2010 04:37 AM
Hi RhombusVS,
Could I ask what programs you are using to write this?
I found this article which may help: http://zone.ni.com/devzone/cda/tut/p/id/2820
Let me know if you are still having problems,
Kind Regards,
01-14-2010 04:52 AM
Hi Owen
I'm using Vb.NET 2005, I had already found the article you mention but that relates to the old VB6 component works, I did not spot anything which could help me.
RhombusVS
01-14-2010 04:59 AM
Sorry Owen
I just realised you were asking which NI package I was using.
I have Measurement Studio 8.1.2 installed with Visual Studio.NET 2005 and .Net Framework 2.05 SP2
RhombusVS
01-15-2010 08:05 AM
Hi RhombusVS,
Could you explain the problem a little more? I can see in the help files what you were talking about "This property value has an effect only if CursorCrosshairMode is set to Custom. " and this property "HorizontalCrosshairLength" can be used to set the length of the horizontal crosshair. What do you mean you don't understand the way it relates to your X dataset?
Kind Regards,
01-15-2010 11:00 AM
Hi Owen
consider this XY data set
x()=[0,10,20,30,40,50,60,70,80,90]
y()=[0,1,5,5,6,5,5,1,1,0]
I am trying to display the full width half maximum (FWHM) of this data set using an XYCursor on a scattergraph.
I plot the data on a scattergraph.
I also have an XYCursor on the graph, I set the Xposition=4 (the centre of the peak) and the Yposition=3 (half the max value in Y)
What I want to do is set the Horizontal Crosshair Length =50 of my X units, which is the width of the peak at Y=3.
However the Horizontal Crosshair Length property does not say what its units are and I have not been able to reverse engineer them.
Does this help explain what I'm trying to do?
Graeme
01-15-2010 01:47 PM - edited 01-15-2010 01:50 PM
Hey Graeme -
The units are basically in pixels. Here's one way you could go about calculating the width you're interested in. The code has been simplified to deal with your example data set, and statically chooses the cursor location:
Let me know if this isn't what you were looking for.
NickB
National Instruments
01-17-2010 10:09 AM
Thanks Nick
Your example did not do exactly what I needed but by clarifying that the units are pixels, I have now been able the to use the bounds of the plot area and scale them by my xdata to allow me to set my cursor width to what I need
Graeme