Skip to content

Commit 973acb7

Browse files
author
Bert Vandenbroucke
committed
Merge branch 'master' into multiple-registration-files
2 parents 1ea3626 + 6489257 commit 973acb7

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

velociraptor/autoplotter/objects.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from unyt import unyt_quantity, unyt_array, matplotlib_support
1414
from unyt.exceptions import UnitConversionError
1515
from numpy import log10, linspace, logspace, array, logical_and, ones
16-
from matplotlib.pyplot import Axes, Figure, close
16+
from matplotlib.pyplot import Axes, Figure, close, subplots
1717
from yaml import safe_load
1818
from typing import Union, List, Dict, Tuple
1919
from pathlib import Path
@@ -829,7 +829,8 @@ def _make_plot_scatter(
829829
y = self.get_quantity_from_catalogue_with_mask(self.y, catalogue)
830830
y.convert_to_units(self.y_units)
831831

832-
fig, ax = plot.scatter_x_against_y(x, y)
832+
fig, ax = subplots()
833+
plot.scatter_x_against_y(ax=ax, x=x, y=y)
833834
self._add_lines_to_axes(ax=ax, x=x, y=y)
834835

835836
return fig, ax

velociraptor/autoplotter/plot.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@
1616
import velociraptor.tools as tools
1717

1818

19-
def scatter_x_against_y(
20-
x: unyt.unyt_array, y: unyt.unyt_array
21-
) -> Tuple[plt.Figure, plt.Axes]:
19+
def scatter_x_against_y(ax: plt.Axes, x: unyt.unyt_array, y: unyt.unyt_array) -> None:
2220
"""
23-
Creates a scatter of x against y (unyt arrays).
21+
Plots a scatter of x against y (unyt arrays).
2422
"""
2523

26-
fig, ax = plt.subplots()
27-
2824
kwargs = dict(edgecolor="none", zorder=-100)
2925

3026
# Need to "intelligently" size the markers
@@ -38,7 +34,7 @@ def scatter_x_against_y(
3834

3935
ax.scatter(x.value, y.value, **kwargs)
4036

41-
return fig, ax
37+
return
4238

4339

4440
def histogram_x_against_y(

0 commit comments

Comments
 (0)