-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hopefully fixed the plotting issues I've had with scaling relations
- Loading branch information
Showing
1 changed file
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS). | ||
# Last modified by David J Turner ([email protected]) 28/01/2025, 13:08. Copyright (c) The Contributors | ||
# Last modified by David J Turner ([email protected]) 28/01/2025, 13:12. Copyright (c) The Contributors | ||
|
||
import inspect | ||
import pickle | ||
|
@@ -950,11 +950,6 @@ def get_view(self, ax: Axes, x_lims: Quantity = None, log_scale: bool = True, pl | |
# Setting the axis limits | ||
ax.set_xlim(x_lims) | ||
|
||
# Making the scale log if requested | ||
if log_scale: | ||
ax.set_xscale("log") | ||
ax.set_yscale("log") | ||
|
||
# Setup the aesthetics of the axis | ||
ax.minorticks_on() | ||
ax.tick_params(axis='both', direction='in', which='both', top=True, right=True) | ||
|
@@ -1054,12 +1049,12 @@ def get_view(self, ax: Axes, x_lims: Quantity = None, log_scale: bool = True, pl | |
|
||
relation_label = " ".join([self._author, self._year, '-', mod_name, | ||
"- {cf}% Confidence".format(cf=conf_level)]) | ||
# plt.plot(model_x * self._x_norm.value, model_median, color=model_colour, label=relation_label) | ||
# | ||
# plt.plot(model_x * self._x_norm.value, model_upper, color=model_colour, linestyle="--") | ||
# plt.plot(model_x * self._x_norm.value, model_lower, color=model_colour, linestyle="--") | ||
# ax.fill_between(model_x * self._x_norm.value, model_lower, model_upper, where=model_upper >= model_lower, | ||
# facecolor=model_colour, alpha=0.6, interpolate=True) | ||
plt.plot(model_x * self._x_norm.value, model_median, color=model_colour, label=relation_label) | ||
|
||
plt.plot(model_x * self._x_norm.value, model_upper, color=model_colour, linestyle="--") | ||
plt.plot(model_x * self._x_norm.value, model_lower, color=model_colour, linestyle="--") | ||
ax.fill_between(model_x * self._x_norm.value, model_lower, model_upper, where=model_upper >= model_lower, | ||
facecolor=model_colour, alpha=0.6, interpolate=True) | ||
|
||
# Now the relation/data have been plotted, we'll see if the user wanted any custom y-axis limits. If not then | ||
# nothing will happen and we'll go with whatever matplotlib decided. Also check that the input was | ||
|
@@ -1072,6 +1067,11 @@ def get_view(self, ax: Axes, x_lims: Quantity = None, log_scale: bool = True, pl | |
# Setting the axis limits | ||
ax.set_ylim(y_lims.value) | ||
|
||
# Making the scale log if requested | ||
if log_scale: | ||
ax.set_xscale("log") | ||
ax.set_yscale("log") | ||
|
||
# I can dynamically grab the units in LaTeX formatting from the Quantity objects (thank you astropy) | ||
# However I've noticed specific instances where the units can be made prettier | ||
# Parsing the astropy units so that if they are double height then the square brackets will adjust size | ||
|
@@ -1860,11 +1860,6 @@ def get_view(self, ax: Axes, x_lims: Quantity = None, log_scale: bool = True, pl | |
# Setting the axis limits | ||
ax.set_xlim(x_lims) | ||
|
||
# Making the scale log if requested | ||
if log_scale: | ||
ax.set_xscale("log") | ||
ax.set_yscale("log") | ||
|
||
# Setup the aesthetics of the axis | ||
ax.minorticks_on() | ||
ax.tick_params(axis='both', direction='in', which='both', top=True, right=True) | ||
|
@@ -1930,6 +1925,11 @@ def get_view(self, ax: Axes, x_lims: Quantity = None, log_scale: bool = True, pl | |
# Setting the axis limits | ||
ax.set_ylim(y_lims.value) | ||
|
||
# Making the scale log if requested | ||
if log_scale: | ||
ax.set_xscale("log") | ||
ax.set_yscale("log") | ||
|
||
# I can dynamically grab the units in LaTeX formatting from the Quantity objects (thank you astropy) | ||
# However I've noticed specific instances where the units can be made prettier | ||
# Parsing the astropy units so that if they are double height then the square brackets will adjust size | ||
|