LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make zoom-in working on a XY graph

Hi my friends,

 

I run into a new issue on live zooming in view for data range selection. My VI was modified from Dr Altenbach's solution,  ttps://forums.ni.com/t5/LabVIEW/How-to-zoom-in-X-axis-of-a-XY-graph/m-p/3967545?profile.language=en#M1130327, for the similar issue I posted two weeks ago.

 

What I am trying to do: select a range of data on a XY graph with multiple plots using 3 cursors, the cursor 0 specify a point to which the selected plots shift on X-axial and cross at the cursor 0 specified point, the cursor 1  and cursor 2 specify a low limit and high limit of the data range, so cursor 0 should be in between cursor 1 and cursor 2 in X-axial value as illustrated on the data selection page (default). There are radio buttons for selecting which plots to shift and the calculated values for shifting the selected plots are also shown. plots shift are automatically done once data range is selected. The selected data are also plotted on a separate page: selected data graph view.

 

Issue:  The XY-graph  can not be zoomed in for data range selection.  

 

Dr Altenbach's solution made the zoom in to work when the shift was on manual click. It stooped working after I changed the manual shift to auto shift.

 

It is greatly appreciated if someone can help me out on this challenge.

 

Attached are two VIs, one is my new VI, another one is Dr Altenbach's previous solution

 

Below is a screenshot of the data selection page. The left graph is for data generation, click stop data generation button will move the data and graph on the right for data range selection. The right graph shows shifted plots.

Zoom in issue.png

Gu

 

 

 

 

 

 

 

Download All
0 Kudos
Message 1 of 6
(2,704 Views)

I'm not sure what you are trying to accomplish here. What is the end goal? Are you trying to find the min and max X and Y values from the cursors and zoom in the graph to those values?

 

Can you give more detail of what you think the final graph should look like?

Tim
GHSP
0 Kudos
Message 2 of 6
(2,629 Views)

Ultimately, your zoomed view will show a rectangular subset of the original plot.  I don't understand why you would use 3 cursors to define the view.  Either use 2 X-Y cursors to define a diagonal of the rectangle, or use 4 single dimension cursors (2 X-only plus 2 more Y-only) to define the sides of the rectangle.

 

You might have overconstrained yourself with the 3 cursors, where a user can move them independently while your algorithm expects and depends on some specific relationships among them.

 

Other than that, I don't really understand specifically what you *want* to happen.  My best guess is that you use the X-coord of cursors 1 & 2 to define the X range limits for the zoomed view while you want to use the XY-coords of cursor 0 to say "shift each plot's Y values to force them to pass through this point".  Is that right?

 

For the sake of the user, you might want to make this a 2-step operation.  2 X-only cursors to define the X limits.  (And let your code figure out which one is the min and max).   Then allow interactive shifting on the zoomed view with 1 cursor there.  I think this separation will be more intuitive for your users and also make it easier for you to troubleshoot your algorithm.

 

 

-Kevin P

 

P.S.  The plot colors in the zoomed view really *should* match the original plot colors!  You're adding unnecessary confusion by not matching them.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 6
(2,615 Views)

Hi Kevin,

 

Thank you for your taking time to reply my post.

 

Your understand is very close to what I want to do. I want to use the X-coord of cursors 1 & 2 to define the X range limits (X1 and X2) and use the XY-coords of cursor 0 (X0, Y0) to define a point for all plots to shift, Delta Xs, on X-axial so that all plots cross at the (X0, Y0). The zoom in view is for easy data range selection in the cases that the plots are close to each other and difficult to define the proper cursor positions. X1 and X2 are arbitrary X limits that can include all plots at Y0 level and are the values close to X0, they are required for calculating Delta X for each plot to shift.

 

Real application:  Multiple channel data acquisition respond to similar events at slightly different times, I want to align all channel as if all channels respond to their respective events at the same time for visual comparison of signal variations. This is normally required after a baseline period, and need a zoom in view to find a proper time range for the plots shift as baselines are overlap normally and start to deviate once their respective event occurs.  

 

The screenshot shows exactly what it looks like before and after the plot shift.

 

Thank you again.

Gu 

 

0 Kudos
Message 4 of 6
(2,602 Views)

Hi  Aeastet,

 

Please see my reply to Kevin.

Thank you.

Gu

0 Kudos
Message 5 of 6
(2,596 Views)

@edmonton wrote:

Hi  Aeastet,

 

Please see my reply to Kevin.

Thank you.

Gu


When you make a reply, the reply message is visible to everyone in the forum.  It isn't really replying to any specific message.  So there is no need make a second reply to another message and say "see my other reply".

0 Kudos
Message 6 of 6
(2,586 Views)