246 | def auto_axis_label(ax, y_scale, z_non_zero=True, log_x=False): |
247 | |
248 | if tex_on: |
249 | if z_non_zero: |
250 | ax.set_ylabel("$\\mathrm{f_{\\lambda}}\\ \\mathrm{/\\ 10^{" |
251 | + str(y_scale) |
252 | + "}\\ erg\\ s^{-1}\\ cm^{-2}\\ \\AA^{-1}}$") |
253 | |
254 | else: |
255 | ax.set_ylabel("$\\mathrm{f_{\\lambda}}\\ \\mathrm{/\\ 10^{" |
256 | + str(y_scale) |
257 | + "}\\ erg\\ s^{-1}\\ \\AA^{-1}}$") |
258 | |
259 | if log_x: |
260 | ax.set_xlabel("$\\mathrm{log_{10}}\\big(\\lambda / \\mathrm{\\AA}" |
261 | + "\\big)$") |
262 | |
263 | else: |
264 | ax.set_xlabel("$\\lambda / \\mathrm{\\AA}$") |
265 | |
266 | else: |
267 | if z_non_zero: |
268 | ax.set_ylabel("f_lambda / 10^" + str(y_scale) |
269 | + " erg s^-1 cm^-2 A^-1") |
270 | |
271 | else: |
272 | ax.set_ylabel("f_lambda / 10^" + str(y_scale) |
273 | + " erg s^-1 A^-1") |
274 | |
275 | if log_x: |
276 | ax.set_xlabel("log_10(lambda / A)") |
277 | |
278 | else: |
279 | ax.set_xlabel("lambda / A") |