Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,61 @@ def set_mouseover(self, mouseover):

mouseover = property(get_mouseover, set_mouseover) # backcompat.

def set_datalim_x(self, data):
"""
Set the x-axis data limits for this 3D plot.

Parameters
----------
data : array-like
The array containing data points for the x-axis.
"""
self._datalim_x = (min(data), max(data))

ax = self.axes
if ax:
ax.dataLim.update_from_data_x(self._datalim_x)

datalim_x = property(lambda self: self._datalim_x, set_datalim_x)


def set_datalim_y(self, data):
"""
Set the y-axis data limits for this 3D plot.

Parameters
----------
data : array-like
The array containing data points for the y-axis.
"""
self._datalim_y = (min(data), max(data))

ax = self.axes
if ax:
ax.dataLim.update_from_data_y(self._datalim_y)

datalim_y = property(lambda self: self._datalim_y, set_datalim_y)


def set_datalim_z(self, data):
"""
Set the z-axis data limits for this 3D plot.

Parameters
----------
data : array-like
The array containing data points for the z-axis.
"""
self._datalim_z = (min(data), max(data))

ax = self.axes
if ax:
ax.dataLim.update_from_data_z(self._datalim_z)

datalim_z = property(lambda self: self._datalim_z, set_datalim_z)




def _get_tightbbox_for_layout_only(obj, *args, **kwargs):
"""
Expand Down
5 changes: 5 additions & 0 deletions lib/matplotlib/cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,11 @@ def _is_tensorflow_array(x):

def _unpack_to_numpy(x):
"""Internal helper to extract data from e.g. pandas and xarray objects."""
if isinstance(x, ak.Array):
# Normalize akward irregular arrays to numpy array
xtmp = ak.to_numpy(ak.flatten(x))
print("Entrou")
return xtmp
if isinstance(x, np.ndarray):
# If numpy, return directly
return x
Expand Down