Plt.subplots() error in mantid workbench

I am using mantid workbench version 6.10.0.1 (18 Sep 2024).
My operating system is Red Hat Enterprise Linux, version 9.4 (Plow)

I receive an error when I try:
fig, ax = plt.subplots()

The error is:
AttributeError: ‘WorkbenchNavigationToolbar’ object has no attribute ‘sig_crosshair_toggle_triggered’

I will paste the full error message at the end

Expected behavior

Generate a figure and axes object for matplotlib

Actual behavior

AttributeError: ‘WorkbenchNavigationToolbar’ object has no attribute ‘sig_crosshair_toggle_triggered’

Steps to reproduce the behavior

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

Platforms affected

Mantid Workbench

The full error message

AttributeError: ‘WorkbenchNavigationToolbar’ object has no attribute ‘sig_crosshair_toggle_triggered’
File “”, line 6, in
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/matplotlib/pyplot.py”, line 1501, in subplots
fig = figure(**fig_kw)
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/matplotlib/_api/deprecation.py”, line 454, in wrapper
return func(*args, **kwargs)
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/matplotlib/pyplot.py”, line 840, in figure
manager = new_figure_manager(
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/matplotlib/pyplot.py”, line 384, in new_figure_manager
return _get_backend_mod().new_figure_manager(*args, **kwargs)
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/workbench/plotting/figuremanager.py”, line 650, in new_figure_manager
return new_figure_manager_given_figure(num, this_fig)
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/workbench/plotting/figuremanager.py”, line 664, in new_figure_manager_given_figure
return QAppThreadCall(_new_figure_manager_given_figure_impl)(int(num), figure)
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/mantidqt/utils/qt/qappthreadcall.py”, line 89, in call
else:
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/mantidqt/utils/qt/qappthreadcall.py”, line 107, in _on_call
except Exception: # pylint: disable=broad-except
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/workbench/plotting/figuremanager.py”, line 661, in _new_figure_manager_given_figure_impl
return force_method_calls_to_qapp_thread(FigureManagerWorkbench(canvas, num))
File “/opt/anaconda/envs/mantid/lib/python3.10/site-packages/workbench/plotting/figuremanager.py”, line 235, in init
self.toolbar.sig_crosshair_toggle_triggered.connect(self.crosshair_toggle)

Hi Elscan,

Thank you for the error report. To diagnose the problem, can you reply with the following information:

  • Mantid Workbench version
  • Operating system
  • Did you use a standalone installer to install Mantid (i.e. from this link), or did you use Conda?

Many thanks,
Rob

I edited my question to answer your first two points (workbench version and operating system).
As for how mantid was installed, I did not install it.
It is installed on one of ORNL’s virtual machines which I access via ThinLinc.

Thank you, I have referred you to the relevant ORNL Mantid software developers. They will get back to you soon

Hello, mantid developer here. We are trying to reproduce this issue. The crosshair feature was deployed in 6.11 about two weeks ago. When I open thinlinc I get 6.11.0.1 version of mantid. Are you able to log out and log back into thinlinc starting a new instance? This may help you to use the latest mantid version.

That worked, thank you