ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
01-19-2009 06:19 AM
Hello...
I need to plot multiple plots on a single graph but the number of elements of each plot will be different among the plots (i.e. plot 0 will have 3 elements, plot 1 will have 5 elements, plot 2 will have 7 elements. Just for example.). When I add a new element to the plot 0 (for example), all the plots have 1 new element added with the value 0, but I don't want this. I want that, for example, that plot 0 has 3 elements, plot 1 has 5 elements, plot 2 has 8 elements...
What could I change in my code to solve this issue?
Thanks
Dan07
Solved! Go to Solution.
01-19-2009 06:37 AM
You need to use X-Y graph. X-Y plot data is a cluster containing two arrays: one for the X coordinates, the other for the Y.
In a multiple plot X-Ygraph, each plot has its own X array, so the number of points doesn't need to be the same.
01-19-2009 11:55 AM - edited 01-19-2009 11:56 AM
Hello Pincpanter...
Thanks for the attention.
I modified the code as you suggested but I am still facing the problem: When I add a new element to a specific plot, all the other plots had added a new element at the position Y0 X0. What could I modify to solve?
The code its attached.
Thanks again
Dan07
01-19-2009 01:23 PM - edited 01-19-2009 01:26 PM
Does merge signals work?
01-19-2009 01:35 PM - edited 01-19-2009 01:36 PM
Cory K wrote:Does merge signals work?
You can just convert the arrays to dynamic data.
This dynamic data can be used as a signal, then you can use merge signals.
* You cannot use an XY graph as stated above, because that would require you had the same number of x's as y's.
Therefore, you cannot bundle array 1 vs array 2 because it would make the previously stated assumptionMessage Edited by Cory K on 01-19-2009 01:26 PM
* I'm not exactly sure if there are any negative side effects of converting this to dynamic data, maybe someone could jump in and let me know if I should be avoiding that. However, assuming that it doesn't make any problems, it does work.
01-19-2009 02:00 PM
I can't think of any negative reactions to the conversion of dynamic data from a simple 1D array. In fact, you'll notice that if you wire a 1D array of doubles to the merge signals, it automatically places the conversion for you. However, an I32 will give you a coersion dot.
I might try it first to see if it gives you desired results.
01-20-2009 05:31 AM
Dan,
You're not creating the inputs of your XY graph the right way. You're creating 2D arrays of X and Y values and plotting them.
You should check the example XY Graph.vi. It shows different uses of the XY Graph for single and multiple plots.
Regards,
Dario Camargo
NI Brazil
#1322269
01-20-2009 11:43 AM
Hello...
I need to create many plots in a single graph. Each plot will have points (bullets) connected by lines (sometimes will be 3 points, sometimes 4 or more....). Each point will be placed taking into consideration its X value and its Y value. The problem that I am facing is that all the plots does not have always the same number of points. Using the example XY Graph.VI I will be able to achieve what I need?
Thanks
Dan07
01-20-2009 12:20 PM
Dan -
If you look at the example you will see that the number of interactions of the for loop determines the number of X points. Consequently all the graphs have the same number of X points.
You can plot different functions with different specified point numbers but for that you would need to alter the example and put multiple for loops.
However if you want a program that you define the number of points and their Cartesian values and plot the graph then the merge signal that was mentioned above is better. I played around with the vi that you sent and substituted the "Build Array.vi" for merge signals and apparently it worked fine. Try it see if this result fits. The merge signal automatically converts data.
Best Regards
Bruno Noronha
01-20-2009 12:29 PM - edited 01-20-2009 12:30 PM