Skip to content

Commit 552bae2

Browse files
authored
Merge 5b5843f into 4195021
2 parents 4195021 + 5b5843f commit 552bae2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

csep/core/catalogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ def plot(self, ax=None, show=False, extent=None, set_global=False, plot_args=Non
833833
'legend_loc': 3,
834834
'figsize': (8, 8),
835835
'title': self.name,
836-
'mag_ticks': [4.0, 5.0, 6.0, 7.0]
836+
'mag_ticks': False
837837
}
838838
# Plot the region border (if it exists) by default
839839
try:

csep/utils/plots.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,12 +751,16 @@ def size_map(markersize, values, scale):
751751
# Legend
752752
if legend:
753753
if not mag_ticks:
754-
mag_ticks = numpy.round(numpy.linspace(mw_range[0], mw_range[1], 4), 1)
754+
mag_ticks = numpy.linspace(mw_range[0], mw_range[1], 4)
755+
else:
756+
if not numpy.all([ i >= mw_range[0] and i <= mw_range[1] for i in mag_ticks]):
757+
print("Magnitude ticks do not lie within the catalog magnitude range")
758+
755759
handles, labels = scatter.legend_elements(prop="sizes",
756760
num=list(size_map(markersize, mag_ticks, mag_scale)),
757761
alpha=0.3)
758-
ax.legend(handles, mag_ticks,
759-
loc=legend_loc, title=r"Magnitudes",title_fontsize=16,
762+
ax.legend(handles, numpy.round(mag_ticks, 1),
763+
loc=legend_loc, title=r"Magnitudes", title_fontsize=16,
760764
labelspacing=labelspacing, handletextpad=5, framealpha=False)
761765

762766
if region_border:

0 commit comments

Comments
 (0)