Use the Axis() function to generate Axis for the plot.
Optional Arguments:
- cmap: Specifies the name of the colormap to be used for plotting.This argument is significant only when corresponding type of plots is Mesh Plot or Geometry Plot. 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.Permitted values:
- 'blue'
- 'orange'
- 'green'
- 'red'
- 'purple'
- 'brown'
- 'pink'
- 'gray'
- 'olive'
- 'cyan'
- Colors mentioned in RGB Monitor Colors
Default value is 'blue'.
Hexadecimal color codes are not supported. - grid_color: Specifies the color of the grid.
By default, grid is generated with Gray69(#b0b0b0) color.
Permitted values:- 'blue'
- 'orange'
- 'green'
- 'red'
- 'purple
- 'brown'
- 'pink'
- 'gray'
- 'olive'
- 'cyan'
- Colors mentioned in RGB Monitor Colors
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.
- 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).
- 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.
- 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).
- 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.
- If vmin and vmax are not specified, then range is derived from existing values. Thus, colors are represented in the whole range as follows :
Example 1: Create an Axis with marker as 'Pentagon'
>>> from teradataml import Axis
>>> ax = Axis(marker="p")
Example 2: Create an Axis without x-tick and y-tick but have grid in the format of '-.'
>>> from teradataml import Axis
>>> ax = Axis(xtick_format="", ytick_format="", grid_linestyle="-.")
Example 3: Create an Axis plotting only for the values between -10 to 100 on x-axis
>>> from teradataml import Axis
>>> ax = Axis(xlim=(-10, 100))
Example 4: Create an Axis displaying legend at upper left corner, and without x and y axis labels
>>> from teradataml import Axis
>>> ax = Axis(legend_style="upper left", xlabel="", ylabel="")
Example 5: Create an Axis to format the y-axis tick values to display up to two decimal points
Use the color 'dark green' for plotting. Consider y-axis data has 5 digit floating numbers.
>>> from teradataml import Axis
>>> ax = Axis(ytick_format="99999.99", color='dark green')