Load.find_contour#

FindLinesManager.find_contour(var: str | ndarray, **kwargs: Unpack[FindContourKwargs]) list[source]

Generate contour lines for a given variable.

Parameters:
- levels: int | np.ndarray, default 10

The levels of number of levels or the list of levels for the contours. If an integer is provided, the levels are generated using a linear or logarithmic scale. If an array is provided, the levels are taken from the array.

- levelscale: str, default ‘linear’

The scale of the levels. Available options are ‘linear’ and ‘logarithmic’.

- line_cmap: str, default ‘k’

The colormap to use to associate each level with a color. The colormap can also be a color, which is used for all the levels. If not provided, all the lines are associated with the color black.

- transpose: True/False, default False

Transposes the variable matrix. Use is not recommended if not really necessary (e.g. in case of highly customized variables and plots).

- var (not optional): str | np.ndarray

The variable to plot. If a string is provided, the variable is taken from the dataset.

- vmax: float

The maximum value of the variable to be computed / plotted.

- vmin: float

The minimum value of the variable to be computed / plotted.

- x1: np.ndarray, default self.x1

The x1 coordinates. If the geometry is non-Cartesian, the x1 cartesian coordinates are taken from the dataset.

- x2: np.ndarray, default self.x2

The x2 coordinates. If the geometry is non-Cartesian, the x2 cartesian coordinates are taken from the dataset.

Returns:
  • lines_list: list

    List of contour lines. The strcuture of the list is [[x1, y1], [x2, y2], …] where x1, y1, x2, y2 are numpy arrays representing the coordinates of the field lines.

Examples

  • Example #1: Generate contour lines for a given variable.

    >>> lines_list = find_contour(var)
    
  • Example #2: Generate contour lines for a given variable and

    coordinates.

    >>> lines_list = find_contour(var, x1=x1, x2=x2)
    
  • Example #3: Generate contour lines for a given variable and

    coordinates with a logarithmic scale.

    >>> lines_list = find_contour(var, x1=x1, x2=x2,
    >>> ... levelscale='logarithmic')
    
  • Example #4: Generate contour lines for a given variable and

    coordinates with a logarithmic scale and a colormap.

    >>> lines_list = find_contour(var, x1=x1, x2=x2,
    >>> ... levelscale='logarithmic', line_cmap='jet')