07-27-2010 12:56 PM
Hello,
I was hoping to make a graph that has movable plots. Here is the scenario: An excel file is imported, column 1 contains the x-axis, column 2 contains the y-axis. This is repeated 3 more time. Overall: 4 plots. I want to be able to plot the data on one graph and grab a certain plot and move it horizontally.
Thanks in advanced.
07-27-2010 03:13 PM
ADrexelDragon a écrit :
Hello,
I was hoping to make a graph that has movable plots. Here is the scenario: An excel file is imported, column 1 contains the x-axis, column 2 contains the y-axis. This is repeated 3 more time. Overall: 4 plots. I want to be able to plot the data on one graph and grab a certain plot and move it horizontally.
Thanks in advanced.
So where is the problem ? Do you have difficulties in plotting the 4 curves on the same graph (build an array containing the 4 XY clusters and wire it to an XYgraph), or with "grabing a plot". In the later case, you should explain what you want to do : do you mean moving one plot, while the others remain steady (which implies adding an offset to the X scale of this graph) ?
07-27-2010 05:29 PM
The attached vi is just a graph of 2 plots and then a graph of the plots separate. I want to be able to move the plots on the graph horizontally. For example, I want to align the graphs so the maximums are on top of each other. I might have to change the x values of the plot according to the offset. Right now the offset does nothing for me.
07-27-2010 11:00 PM
OK, this is an interesting project. You'll have to play a lot with mouse events
1/ Xscale offset. I was not referring to the Xscale graph, but to the Xscale data. Add the offset directly to the Xdata. Turn off the autoscale property of the X axis on the graphs to have a better perception of what's happening.
2/ Detect the mouseDown events, and wire the mouseDown coordinates to the input of a graph "Map coord to XY" invoke node (right click the graph, select create > invoke node > Map coord to XY). Use an Unbundle by name node to get the X value. Store the value in a shift register.
3/ Detect the mouseMove event, and find the way to subtract the X value to the stored one, only when a mouseDown has occurred. This will give you an offset.
4/ See how far you go from there.
07-27-2010 11:10 PM
Here is what I have. I do not know how to actually grab the plots.
07-27-2010 11:20 PM
Creating a smooth UI represents usually a lot of work. Be prepared to learn (and wire...) a lot. Just sweat and tears.
If you want to be able to grab a plot, and to move it around, you need to learn how to use mouse events. And first, you'll have to use an event structure. Go again through my previous answer.
Now, if you are in a hurry, your VI is already the best solution.