nanophotonics / nplab

Core functions and instrument scripts for the Nanophotonics lab experimental scripts
GNU General Public License v3.0
38 stars 15 forks source link

ViewBox of graphs in preview_widget of Camera base class extends beyond widget edges. #97

Closed eoinell closed 4 years ago

eoinell commented 4 years ago

This occurs in python 2 and 3, but only on the python3 branch.

The example I've seen is using the Andor: When you take a single-track spectrum, the x-axis extends beyond the edges of the widget such that it's no longer possible to see the values on the y-axis.

It seems to be in here: https://github.com/nanophotonics/nplab/blob/1acbb60874e39e2b540e25a2c152ebb049dc227c/nplab/instrument/camera/camera_scaled_roi.py#L215

It doesn't do so when taking an image however.

YagoDel commented 4 years ago

Screenshot please 🙇

eoinell commented 4 years ago

image image image image

Each is a before/after image pair of clicking capture in single track mode. (the 1st gui hasn't set the x_axis)

eoinell commented 4 years ago

I made a dummy class just there of CamerScaledRoi which replicates the issue; it works in master but not in python3

eoinell commented 4 years ago

Side-by-side: image

YagoDel commented 4 years ago

For anyone looking at this, the fix is line 204 in 25713c882112a3d0a765b00c9d4e5bad6d95df7a