sgpykit.util.plot
Functions
Check if the given axis is a 3D axis, and convert it if necessary. |
|
|
|
|
|
|
|
|
|
|
Merge positional and keyword arguments into a single dictionary. |
|
Parse MATLAB-style plot arguments into a format string and keyword arguments. |
|
Plot data on a given axis with optional formatting. |
|
Create a 3D line plot on a given axis with optional formatting. |
|
Create a 3D scatter plot on a given axis with optional formatting. |
|
Set the legend location in Matplotlib based on MATLAB's legend location strings. |
|
Set the view angle for a 3D plot in Matplotlib. |
Classes
|
3D Axes object. |
- sgpykit.util.plot.check_and_convert_to_fig3d(ax)[source]
Check if the given axis is a 3D axis, and convert it if necessary.
- Parameters:
- axmatplotlib.axes.Axes
The axis to check and convert.
- Returns:
- matplotlib.axes.Axes3D
The 3D axis.
- sgpykit.util.plot.parse_matlab_plot_args(*args, **kwargs)[source]
Parse MATLAB-style plot arguments into a format string and keyword arguments.
- Parameters:
- *argstuple
Positional arguments for formatting.
- **kwargsdict
Keyword arguments for formatting.
- Returns:
- tuple
A tuple containing the format string and a dictionary of keyword arguments.
- sgpykit.util.plot.plot(ax, x, y, *args, **kwargs)[source]
Plot data on a given axis with optional formatting.
- Parameters:
- axmatplotlib.axes.Axes
The axis to plot on.
- xarray_like
The x-coordinates of the data points.
- yarray_like
The y-coordinates of the data points.
- *argstuple
Additional positional arguments for formatting.
- **kwargsdict
Additional keyword arguments for formatting.
- Returns:
- list of matplotlib.lines.Line2D
The plotted line objects.
- sgpykit.util.plot.plot_3d(ax, x, y, z, *args, **kwargs)[source]
Create a 3D line plot on a given axis with optional formatting.
- Parameters:
- axmatplotlib.axes.Axes3D
The 3D axis to plot on.
- xarray_like
The x-coordinates of the data points.
- yarray_like
The y-coordinates of the data points.
- zarray_like
The z-coordinates of the data points.
- *argstuple
Additional positional arguments for formatting.
- **kwargsdict
Additional keyword arguments for formatting.
- Returns:
- matplotlib.lines.Line2D
The plotted line object.
- sgpykit.util.plot.plot_scatter_3d(ax, x, y, z, *args, **kwargs)[source]
Create a 3D scatter plot on a given axis with optional formatting.
- Parameters:
- axmatplotlib.axes.Axes3D
The 3D axis to plot on.
- xarray_like
The x-coordinates of the data points.
- yarray_like
The y-coordinates of the data points.
- zarray_like
The z-coordinates of the data points.
- *argstuple
Additional positional arguments for formatting.
- **kwargsdict
Additional keyword arguments for formatting.
- Returns:
- matplotlib.collections.PathCollection
The scatter plot object.
- sgpykit.util.plot.set_legend(location)[source]
Set the legend location in Matplotlib based on MATLAB’s legend location strings.
- Parameters:
- locationstr
The desired location for the legend. Options include: ‘NorthEast’, ‘NorthWest’, ‘SouthEast’, ‘SouthWest’, ‘North’, ‘South’, ‘East’, ‘West’, ‘Best’, ‘NorthOutside’, ‘SouthOutside’, ‘EastOutside’, ‘WestOutside’.
- Raises:
- ValueError
If the provided location is not valid.