Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scousepy/scouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

from astropy import log
import numpy as np
try:
np.set_printoptions(legacy='1.25')
except AttributeError:
pass
import os
import sys
import warnings
Expand Down
7 changes: 5 additions & 2 deletions scousepy/scousecoverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,10 @@ def make_radiobuttons(ax,options,function,**kwargs):
"""
from matplotlib.widgets import RadioButtons
myradiobuttons=RadioButtons(ax,options,**kwargs)
for circle in myradiobuttons.circles: # adjust radius here. The default is 0.05
circle.set_radius(0.05)
try:
for circle in myradiobuttons.circles: # adjust radius here. The default is 0.05
circle.set_radius(0.05)
except AttributeError:
pass
myradiobuttons.on_clicked(function)
return myradiobuttons
13 changes: 11 additions & 2 deletions scousepy/scousefitchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,12 @@ def setup_legend_connections(self, legend, lookup_artist,lookup_handle):
lookup_handle : matplotlib legend handles

"""
for artist in legend.legendHandles:
legend_handles_array = None
try:
legend_handles_array = legend.legendHandles
except AttributeError:
legend_handles_array = legend.legend_handles
for artist in legend_handles_array:
artist.set_picker(True)
artist.set_pickradius(10) # 10 points tolerance

Expand All @@ -714,7 +719,11 @@ def build_legend_lookups(self, legend):

"""
labels = [t.get_text() for t in legend.texts]
handles = legend.legendHandles
handles = None
try:
handles = legend.legendHandles
except AttributeError:
handles = legend.legend_handles
label2handle = dict(zip(labels, handles))
handle2text = dict(zip(handles, legend.texts))
lookup_artist = {}
Expand Down
13 changes: 11 additions & 2 deletions scousepy/scousefitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,12 @@ def setup_legend_connections(self, legend, lookup_artist,lookup_handle):
lookup_handle : matplotlib legend handles

"""
for artist in legend.legendHandles:
legend_handles_array = None
try:
legend_handles_array = legend.legendHandles
except AttributeError:
legend_handles_array = legend.legend_handles
for artist in legend_handles_array:
artist.set_picker(True)
artist.set_pickradius(10) # 10 points tolerance

Expand All @@ -820,7 +825,11 @@ def build_legend_lookups(self, legend):

"""
labels = [t.get_text() for t in legend.texts]
handles = legend.legendHandles
handles = None
try:
handles = legend.legendHandles
except AttributeError:
handles = legend.legend_handles
label2handle = dict(zip(labels, handles))
handle2text = dict(zip(handles, legend.texts))
lookup_artist = {}
Expand Down