nion-software / nionswift

Nion Swift is open source scientific image processing software integrating hardware control, data acquisition, visualization, processing, and analysis using Python. Nion Swift is easily extended using Python. It runs on Windows, Linux, and macOS.
http://nion.com/swift
GNU General Public License v3.0
44 stars 33 forks source link

Stacked line plots do not correctly view-to-interval #866

Closed gosselind1 closed 2 years ago

gosselind1 commented 2 years ago

Steps to reproduce:

  1. Generate two lineplots
  2. Drag one over the other to create a stack
  3. Add an interval graphic
  4. Press enter to zoom in

Expected Behavior: Zooms into a window looking similar to this: image

Actual Behavior: Zooms into a window which only accounts for the first layer (the light blue one in this case) image

cmeyer commented 2 years ago

Additional comment (from chat):

I think that in the case of view-to-intervals, that it would make sense to translate the interval to graph coordinates (pixels) and then back to each layer's fractional coordinates and then determine the appropriate y-values (in pixels) for that layer - then use the min/max across all layers to figure out y-scaling. x-axis adjustment is obvious and can be done using any layer.