diff --git a/examples/example_16/ulens_model_fit.py b/examples/example_16/ulens_model_fit.py index e7ddfd00..5f287cef 100644 --- a/examples/example_16/ulens_model_fit.py +++ b/examples/example_16/ulens_model_fit.py @@ -38,7 +38,7 @@ except Exception: raise ImportError('\nYou have to install MulensModel first!\n') -__version__ = '0.36.1' +__version__ = '0.36.2' class UlensModelFit(object): @@ -3143,7 +3143,12 @@ def _mark_second_Y_axis_in_best_plot(self): return ticks = mm.Utils.get_mag_from_flux(flux) - ax2.set_yticks(ticks, labels) + try: # matplotlib version 3.5 or later + ax2.set_yticks(ticks=ticks, labels=labels) + except Exception: # matplotlib version 3.4.X or smaller + ax2.set_yticks(ticks=ticks) + ax2.set_yticklabels(labels=labels) + ax2.set_ylim(ylim[0], ylim[1]) def _second_Y_axis_settings(self): @@ -3209,7 +3214,7 @@ def _second_Y_axis_minor_ticks(self, ax2, A_values, ref_fluxes): Get minor ticks for magnification axis from matplotlib """ ax2.minorticks_on() - minor_ticks_A = ax2.yaxis.get_ticklocs(minor=True) + minor_ticks_A = np.array(ax2.yaxis.get_ticklocs(minor=True)) minor_ticks_A = minor_ticks_A[~np.isin(minor_ticks_A, A_values)] minor_ticks_flux = ref_fluxes[0] * minor_ticks_A + ref_fluxes[1]