pycba.vehicle.plot_vehicle#

plot_vehicle(vehicle, ax=None, title=None, units=None, color='tab:red', show=True)[source]#

Plot a vehicle’s axles as scaled load arrows along its wheelbase.

Each axle is an arrow whose height scales with its load and is labelled with the load magnitude; the title reports the total axle load and the wheelbase.

Parameters:
  • vehicle (Vehicle) – The vehicle to draw (a pycba.bridge.Vehicle).

  • ax (matplotlib.axes.Axes, optional) – Axes to draw into; a new figure is created if omitted.

  • title (str, optional) – A title for the plot. The total axle load and wheelbase are appended.

  • units (str or pycba.units.UnitSystem, optional) – Display unit system for the labels (see pycba.set_units()). PyCBA is unit-agnostic, so this only relabels the axle loads and the axis - the values are not converted (the built-in models are in kN, m).

  • color (str) – Colour of the axle-load arrows.

  • show (bool) – Call matplotlib.pyplot.show() before returning when a new figure is created (default True).

Return type:

matplotlib.axes.Axes

Raises:

TypeError – If vehicle is not a Vehicle.