vec_plot

Plotting vector data.

This module can be used in two different ways:

  1. As a library. Just import the module and call the functions. This is the way, how this module is used in openpivgui, for example.
  2. As a terminal-application. Execute python3 -m openpivgui.vec_plot –help for more information. This is the way, how this module ist used in JPIV, for example. For now, not all functions are callable in this way.
openpivgui.vec_plot.contour(data, parameter, figure)

Display a contour plot

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • parameter (openpivgui.OpenPivParams.py) – Parameter-object.
  • figure (matplotlib.figure.Figure) – An (empty) Figure object.
openpivgui.vec_plot.contour_and_vector(data, parameter, figure, **kw)

Display a contour plot

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • parameter (openpivgui.OpenPivParams.py) – Parameter-object.
  • figure (matplotlib.figure.Figure) – An (empty) Figure object.
openpivgui.vec_plot.get_dim(array)

Computes dimension of vector data.

Assumes data to be organised as follows (example): x y v_x v_y .. 16 16 4.5 3.2 .. 32 16 4.3 3.1 .. 16 32 4.2 3.5 .. 32 32 4.5 3.2 .. .. .. .. ..

Parameters:array (np.array) – Flat numpy array.
Returns:Dimension of the vector field (x, y).
Return type:tuple
openpivgui.vec_plot.histogram(data, figure, quantity, bins, log_y)

Plot an histogram.

Plots an histogram of the specified quantity.

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • figure (matplotlib.figure.Figure) – An (empty) Figure object.
  • quantity (str) – Either v (abs v), v_x (x-component) or v_y (y-component).
  • bins (int) – Number of bins (bars) in the histogram.
  • log_scale (boolean) – Use logaritmic vertical axis.
openpivgui.vec_plot.pandas_plot(data, parameter, figure)

Display a plot with the pandas plot utility.

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • parameter (openpivgui.OpenPivParams.py) – Parameter-object.
  • figure (matplotlib.figure.Figure) – An (empty) figure.
Returns:

Return type:

None.

openpivgui.vec_plot.profiles(data, parameter, fname, figure, orientation)

Plot velocity profiles.

Line plots of the velocity component specified.

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • fname (str) – A filename containing vector data. (will be deprecated in later updates)
  • figure (matplotlib.figure.Figure) – An (empty) Figure object.
  • orientation (str) – horizontal: Plot v_y over x. vertical: Plot v_x over y.
openpivgui.vec_plot.scatter(data, figure)

Scatter plot.

Plots v_y over v_x.

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • figure (matplotlib.figure.Figure) – An (empty) Figure object.
openpivgui.vec_plot.streamlines(data, parameter, figure)

Display a streamline plot.

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • parameter (openpivgui.OpenPivParams.py) – Parameter object.
  • figure (matplotlib.figure.Figure) – An (empty) Figure object.
openpivgui.vec_plot.vector(data, parameter, figure, invert_yaxis=True, valid_color='blue', invalid_color='red', **kw)

Display a vector plot.

Parameters:
  • data (pandas.DataFrame) – Data to plot.
  • figure (matplotlib.figure.Figure) – An (empty) Figure object.