Tank Plots Class#

class rocketpy.plots.tank_plots._TankPlots[source]#

Class that holds plot methods for Tank class.

Variables:

_TankPlots.tank (Tank) – Tank object that will be used for the plots.

__init__(tank)[source]#

Initializes _MotorClass class.

Parameters:

tank (Tank) – Instance of the Tank class

Return type:

None

_generate_tank(translate=(0, 0), csys=1)[source]#

Generates a matplotlib patch object that represents the tank.

Parameters:
  • ax (matplotlib.axes.Axes, optional) – Axes object to plot the tank on. If None, a new figure and axes will be created.

  • translate (tuple, optional) – Tuple of floats that represents the translation of the tank geometry.

  • csys (float, optional) – Coordinate system of the tank, this will define the orientation of the tank. Default is 1, which means that the tank will be drawn with the nose cone pointing left.

Returns:

tank – Polygon object that represents the tank.

Return type:

matplotlib.patches.Polygon

draw(*, filename=None)[source]#

Draws the tank geometry.

Parameters:

filename (str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).

Return type:

None

fluid_volume(filename=None)[source]#

Plots both the liquid and gas fluid volumes.

Parameters:

filename (str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).

fluid_height(filename=None)[source]#

Plots both the liquid and gas fluid height.

Parameters:

filename (str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).

fluid_center_of_mass(filename=None)[source]#

Plots the gas, liquid and combined center of mass.

Parameters:

filename (str | None, optional) – The path the plot should be saved to. By default None, in which case the plot will be shown instead of saved. Supported file endings are: eps, jpg, jpeg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff and webp (these are the formats supported by matplotlib).

all()[source]#

Prints out all graphs available about the Tank. It simply calls all the other plotter methods in this class.

Return type:

None