Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing CWPlot with ScatterPlot

With the upgrade to the latest NI Measurement (8.x) we are moving from using CWPlot to ScatterPlot to draw our histograms. I found that with exact data points the plots resulting from using the ScatterPlot differ significantly to the previous ones using CWPlot. Any suggestions as to why or how do I make them the same. Additionally what is the difference between ScatterPlot and ScatterGraph. Should I have used the ScatterGraph instead?
0 Kudos
Message 1 of 8
(8,363 Views)
Hi labaster,

You should be able to use the ScatterGraph in .NET to create a histogram display that mirrors what you did with the ActiveX graph and its plots (i.e. cwplot).  I would be curious to see the code you are currently try to use to display a histogram.  Also, screenshots of what  your .NET graph looks like and what your ActiveX graph looks like would be helpful as well to see what your end goal is. 

To answer your question about the ScatterGraph and ScatterPlots, you should probably read the Key Measurement Studio Windows Forms Scatter and Waveform Graph .NET Control Features help topic found in the NI Measurement Studio Help.  This gives you a nice intro into the graphs. Just as a quick note, a ScatterGraph contains a plots collection which in turn contains individual plots (i.e. ScatterPlots). 

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 8
(8,359 Views)
Hi Jonathan, thanks for the reply. I used the method plotXvsY in the ActiveX and plotXY in the ScatterPlot class. I got the following results: they look similar but there are differences. Maybe I set some variables incorrectly? What are the baseXValue and baseYValue for in the ScatterPlot class?

0 Kudos
Message 3 of 8
(8,342 Views)
Hi labaster,

You use the BaseXValue and BaseYValue properties to set/get the values from which you draw fills, lines or bins to. We have a shipping example that demonstrates how to use these features called ToBase located in C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Examples\UI\WindowsForms\Graph directory. That path might be different on your machine depending upon your OS and version of Measurement Studio you have.

With regards to your histogram comparison, honestly those graphs look very, very similar and I can't really see any differences. Now, I don't doubt there could possibly be a slight difference between the two graphs since the implementations are difference (i.e. ActiveX vs .NET).  Based off what you are showing to me, I think our implementation is fine.  However, if you can provide more specifics on what you "don't like" about the .NET implementation, I could investigate that problem if it actually appears to be a problem. 

Maybe the best question I can ask is, what is the exact problem with the .NET ScatterGraph plot? Maybe provide some more details on that.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 4 of 8
(8,335 Views)

Hi, I am now trying to plot this histogram using ScatterPlot but I don't want to fill the histogram nor display the bins (just the line profile). I tried setting plot.FillMode = PlotFillMode.Lines; and plot.FillToBaseStyle = FillStyle.None; But nothing I did can showjust the line profile.

0 Kudos
Message 5 of 8
(8,039 Views)

Hi Labaster,

 

I was testing a ScatterPlot on my end, and when I set the option this way:
 

scatterPlot1.FillMode = NationalInstruments.UI.PlotFillMode.None;

 

I received the desired behavior (area below the curve is not filled).  Could you give this a shot and see how it works?  Thanks!

Matt S
National Instruments
Applications Engineer
0 Kudos
Message 6 of 8
(8,027 Views)
Thanks for your quick response. I just tried it, my plot now disappears. When I checked the plot.LineColor or PointColor even FillToBaseColor all of them have values. Did you set anything else? Do you have a picture of your output?
0 Kudos
Message 7 of 8
(8,020 Views)
sorry, ignore my last response...something else in the code setting my line color to background. So, seems your suggestion works!! thanks.
0 Kudos
Message 8 of 8
(8,017 Views)