Commit 197632fe authored by Margaux Mouchene's avatar Margaux Mouchene
Browse files

first commit, not fixing the issue entirely

does not work everytime, not if map hasnt been moved prior to profiling and not if hovering over nans
parent 4f60890c
......@@ -9,7 +9,6 @@ from PyQt5.QtCore import (
pyqtSignal, pyqtSlot,
)
from PyQt5.QtWidgets import (
QWidget, QVBoxLayout,
QPushButton, QToolBar,
......@@ -212,8 +211,8 @@ class myPlotWindow(QWidget):
self.check_axes.setToolTip("When checked, keep axes ranges while"
" hovering on Map. Note that you can "
" still zoom in/out on the plot.")
self.check_axes.stateChanged.connect(
lambda: self.ctrl_axes(self.check_axes))
# self.check_axes.stateChanged.connect(
# lambda: self.ctrl_axes(self.check_axes))
layout.addWidget(self.check_axes)
layout.addWidget(self.plot_widget)
self.setLayout(layout)
......@@ -221,12 +220,13 @@ class myPlotWindow(QWidget):
# connect signals:
self.zoom_button.toggled.connect(self.plot_widget.init_zoom)
def ctrl_axes(self, box):
if box.isChecked():
self.plot_widget.main_plot.autoBtn.mode = 'fix'
else:
self.plot_widget.main_plot.autoBtn.mode = 'auto'
self.plot_widget.main_plot.autoBtnClicked()
# def ctrl_axes(self, box):
# print('checked', box.isChecked())
# if box.isChecked():
# self.plot_widget.main_plot.autoBtn.mode = 'fix'
# else:
# self.plot_widget.main_plot.autoBtn.mode = 'auto'
# self.plot_widget.main_plot.autoBtnClicked()
def on_button_clicked_clearplot(self):
"""
......@@ -441,14 +441,25 @@ class myPlotWidget(pg.GraphicsLayoutWidget):
Called by mouseMoveEvent and MousePressEvent on Map
"""
# remove nodata message if any:
try:
self.main_plot.removeItem(self.nd_text)
self.main_plot.autoRange()
except Exception:
# TODO: this looks dubious...check it?
pass
if self.ptype == 'temporal':
print(self.parentWidget().check_axes.isChecked())
if self.parentWidget().check_axes.isChecked():
print('fix ax')
self.main_plot.disableAutoRange(axis='y')
self.main_plot.autoBtn.mode ='fix'
else:
self.main_plot.autoRange()
print(self.main_plot.autoBtn.mode)
c = self.curves
if self.parentWidget().zoom_button.isChecked():
cz = self.curves2
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment