Options Available for Plot method | Plotting in teradataml - Options Available for Plot Method - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
March 2024
Language
English (United States)
Last Update
2024-04-09
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

Use the Plot() method to generate plots on teradataml DataFrame.

Following types of plots are supported, which can be specified using argument kind:
  • bar plot
  • corr plot
  • geometry plot
  • line plot
  • mesh plot
  • scatter plot
  • wiggle plot
Geometry plot is generated based on geometry column in teradataml GeoDataFrame. Only the columns with ST_GEOMETRY type are allowed for generating geometry plot.
  • The maximum size for ST_GEOMETRY must be less than or equal to 64000.
  • The ST_GEOMETRY shape can be POINT, LINESTRING, and so on. POLYGON allows filling of different colors.
Many of the options available in plot method are also available in Axis and Figure. If Axis or Figure object is passed for ax and figure respectively, then options related to Axis and Figure are ignored.

Required Arguments:

  • y: Specifies GeoDataFrame columns to use for the y-axis data.
    • Geometry plot always requires geometry column and corresponding 'weight' column in a tuple format. 'weight' column represents the weight of a shape mentioned in geometry column.
    • If you do not specify geometry column and specifies Y-Axis as DataFrame Column, then the default geometry column is considered for plotting.

Optional Arguments:

  • x: Specifies a GeoDataFrame column to use for the x-axis data.
    This argument is not significant for geometry plot. It is a required argument for other types of plots.
  • scale: Specifies a GeoDataFrame column to use for scale data to Wiggle Plot and Mesh Plot.
    This argument is significant for wiggle and mesh plots. It is ignored for other types of plots.
  • kind: Specifies the type of plot.
    Permitted vales:
    • 'bar'
    • 'corr'
    • 'geometry'
    • 'line'
    • 'mesh'
    • 'scatter'
    • 'wiggle'

    Default values is 'geometry'.

  • ax: Specifies the axis for the plot.
  • cmap: Specifies the name of the colormap to be used for plotting.
    This argument is significant only when corresponding type of plot is mesh or geometry. It is ignored for other types of plots.
    All the colormaps mentioned in the following URLs are supported.
  • color: Specifies the color for the plot.
    Hexadecimal color codes are not supported.
    Permitted values:
    • 'blue'
    • 'orange'
    • 'green'
    • 'red'
    • 'purple'
    • 'brown'
    • 'pink'
    • 'gray'
    • 'olive'
    • 'cyan'
    • Colors mentioned in RGB Monitor Colors

    Default value is 'blue'.

  • figure: Specifies the figure for the plot.
  • figsize: Specifies the size of the figure in a tuple of two elements: The first element represents width of the plot image in pixels and the second element represents height of plot image in pixels.

    Default value is (640, 480).

  • figtype: Specifies the type of the image to generate.
    Permitted Values:
    • 'png'
    • 'jpg'
    • 'svg'

    Default Value is 'png'.

  • figdpi: Specifies the number of dots per inch for the output image.

    Valid range: [72, 300]

    Default Value is 100 for png and jpg type images.

  • grid_color: Specifies the color of the grid.
    Permitted values:
    • 'blue'
    • 'orange'
    • 'green'
    • 'red'
    • 'purple
    • 'brown'
    • 'pink'
    • 'gray'
    • 'olive'
    • 'cyan'
    • Colors mentioned in RGB Monitor Colors

    Default value is 'gray'.

    Hexadecimal color codes are not supported.
  • grid_format: Specifies the format for the grid.
  • grid_linestyle: Specifies the line style of the grid.
    Permitted values:
    • '-'
    • '–'
    • '-.'

    Default value is '-'.

  • grid_linewidth: Specifies the line width of the grid.

    Valid range: [0.5, 10].

    Default value is 0.8.

  • heading: Specifies the heading for the plot.
  • legend: Specifies the legends for the plot.
  • legend_style: Specifies the location for legend to display on Plot image.

    By default, legend is displayed at upper right corner.

    Permitted values:
    • 'upper right'
    • 'upper left'
    • 'lower right'
    • 'lower left'
    • 'right'
    • 'center left
    • 'center right'
    • 'lower center'
    • 'upper center'
    • 'center'
  • lineyle: Specifies the line style for the plot.
    Permitted values:
    • '-'
    • '--'
    • '-.'
    • ':'

    Default value is '-'.

  • linewidth: Specifies the line width for the plot.

    Valid range: [0.5, 10].

    Default value is 0.8.

  • marker: Specifies the type of the marker to be used.

    All the markers mentioned in matplotlib.markers are supported.

  • markersize: Specifies the size of the marker.

    Valid range: [1, 20].

    Default value is 6.

  • position: Specifies the position of the axis in the Figure.

    This argument accepts a tuple of two elements: The first element represents the row and the second element represents column.

    Default value is (1,1).

  • span: Specifies the span of the axis in the Figure.

    The argument accepts a tuple of two elements: The first element represents the row and the second element represents column.

    For example, span of (2, 1) specifies the Axis occupies 2 rows and 1 column in Figure.

    Default value is (1,1).

  • reverse_xaxis: Specifies whether to reverse tick values on x-axis or not.

    Default value is False.

  • reverse_yaxis: Specifies whether to reverse tick values on y-axis or not.

    Default value is False.

  • series_identifier: Specifies the teradataml GeoDataFrame Column which represents the identifier for the data. As many plots with distinct "series_identifier" are generated in a single Axis.
    For example, consider the following data in teradataml GeoDataFrame:
         ID   x   y
      0  1    1   1
      1  1    2   2
      2  2   10  10
      3  2   20  20
    If series_identifier is not specified, simple plot is generated where every 'y' is plotted against 'x' in a single plot. However, specifying series_identifier as the column 'ID' generates two plots in a single axis: One plot is for' ID' 1 and another plot is for 'ID' 2.
  • title: Specifies the title for the Axis.
  • xlabel: Specifies the label for x-axis.
    • When set to empty string, label is not displayed for x-axis.
    • When set to None, name of the x-axis column is displayed as label.
  • xlim: Specifies the range for xtick values. It is a tuple.
  • xtick_format: Specifies how to format tick values for x-axis.
  • ylabel: Specifies the label for y-axis.
    • When set to empty string, label is not displayed for y-axis.
    • When set to None, name of the y-axis columns are displayed as label.
  • ylim: Specifies the range for ytick values. It is a tuple.
  • ytick_format: Specifies how to format tick values for y-axis.
  • vmin: Specifies the lower range of the colormap. By default, the range is derived from data and color codes are assigned accordingly.
    This argument is significant only for Geometry Plot.
  • vmax: Specifies the upper range of the color map. By default, the range is derived from data and color codes are assigned accordingly.
    This argument is significant only for Geometry Plot.
    For example, assuming you want to use the 'matter' colormap and derive the colors for values which are in between 1 and 100.
    The 'matter' colormap starts with pale yellow and ends with violet.
    • If vmin and vmax are not specified, then range is derived from existing values. Thus, colors are represented in the whole range as follows :

      1 as pale yellow.

      100 as violet.

    • If vmin and vmax are specified as -100 and 100, the value 1 is in the middle of the specified range. Thus, colors are represented in the whole range as follows:

      -100 as pale yellow.

      1 as orange.

      100 as violet.

  • wiggle_fill: Specifies whether to fill the wiggle area or not.

    By default (False), the right positive half of the wiggle is not filled. If specified as True, wiggle area is filled.

    This argument is applicable only for Wiggle Plot.
  • wiggle_scale: Specifies the scale of the wiggle.

    By default, the amplitude of wiggle is scaled relative to RMS of the first payload. In certain cases, it can lead to excessively large wiggles. Use this argument to adjust the relative size of the wiggle.

    This argument is applicable only for Wiggle Plot and Mesh Plot.