Axes

Field Axes

Cartesian2DFieldAxes

class tecplot.plot.Cartesian2DFieldAxes(plot)[source]

(X, Y) axes style control for 2D field plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '2D', 'exchng.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian2D)

plot.show_shade = False
plot.show_contour = True

plot.axes.auto_adjust_ranges = True
plot.axes.precise_grid.show = True

plot.view.fit()

tp.export.save_png('axes_2d.png', 600)
../_images/axes_2d.png

Attributes

auto_adjust_ranges Automatically adjust axis ranges to nice values.
axis_mode Scale dependencies along each axis.
grid_area Area bounded by the axes.
precise_grid Precise dot grid.
preserve_scale Preserve scale (spacing between ticks) on range change.
viewport Area of the frame used by the plot axes.
x_axis X-axis style control.
xy_ratio X – Y axis scaling ratio.
y_axis Y-axis style control.

Methods

next()
Cartesian2DFieldAxes.auto_adjust_ranges

Automatically adjust axis ranges to nice values.

Type:boolean

Axes limits will be adjusted to have the smallest number of significant digits possible:

>>> plot.axes.auto_adjust_ranges = False
Cartesian2DFieldAxes.axis_mode

Scale dependencies along each axis.

Type:AxisMode

Possible values: Independent, XYDependent.

Example usage:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.Independent
Cartesian2DFieldAxes.grid_area

Area bounded by the axes.

Type:GridArea

This controls the background color and border of the axes:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.fill_color = Color.LightGreen
Cartesian2DFieldAxes.next()
Cartesian2DFieldAxes.precise_grid

Precise dot grid.

Type:PreciseGrid

This is a set of small dots drawn at the intersection of every minor gridline. In line plots, the axis assignments for the first active mapping govern the precise dot grid. The precise dot grid option is disabled for the 3D Cartesian plots and Line plots when either axis for the first active line mapping uses a log scale:

>>> plot.axes.precise_grid.show = True
Cartesian2DFieldAxes.preserve_scale

Preserve scale (spacing between ticks) on range change.

Type:boolean

This maintains the axis scaling, i.e. the distance between values along the axis. If False, the axes length will be preserved when the range changes:

>>> plot.axes.preserve_scale = False
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 10 # axis scale is changed (length is preserved)
Cartesian2DFieldAxes.viewport

Area of the frame used by the plot axes.

Type:Cartesian2DViewport

Example usage:

>>> plot.axes.viewport.left = 5
>>> plot.axes.viewport.right = 95
>>> plot.axes.viewport.top = 95
>>> plot.axes.viewport.bottom = 5
Cartesian2DFieldAxes.x_axis

X-axis style control.

Type:Cartesian2DFieldAxis

Example usage:

>>> plot.axes.x_axis.show = False
Cartesian2DFieldAxes.xy_ratio

X – Y axis scaling ratio.

Type:float in percent

This requires the axes to be in dependent mode:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.XYDependent
>>> plot.axes.xy_ratio = 2
Cartesian2DFieldAxes.y_axis

Y-axis style control.

Type:Cartesian2DFieldAxis

Example usage:

>>> plot.axes.y_axis.show = False

Cartesian2DFieldAxis

class tecplot.plot.Cartesian2DFieldAxis(axes, name, **kwargs)[source]

X or Y axis for 2D field plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, AxisMode

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '2D', 'exchng.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian2D)

plot.show_contour = True

plot.axes.axis_mode = AxisMode.Independent
plot.axes.viewport.right = 75
plot.axes.preserve_scale = False

xaxis = plot.axes.x_axis
xaxis.title.text = 'Longitudinal (m)'
xaxis.min = 3.8
xaxis.max = 5.3
xaxis.grid_lines.show = True
xaxis.grid_lines.draw_last = True

yaxis = plot.axes.y_axis
yaxis.title.text = 'Transverse (m)'
yaxis.min = 2.8
yaxis.max = 4.3
yaxis.grid_lines.show = True
yaxis.minor_grid_lines.show = True
yaxis.minor_grid_lines.draw_last = True

tp.export.save_png('axis_2d.png', 600)
../_images/axis_2d.png

Attributes

grid_lines Major grid lines style control.
line Axis line style control.
log_scale Use logarithmic scale for this axis.
marker_grid_line Marker line to indicate a particular position along an axis.
max Upper bound of this axis’ range.
min Lower bound of this axis’ range.
minor_grid_lines Minor grid lines style control.
reverse Reverse the direction of the axis scale.
show Enable drawing of this axis.
tick_labels Axis ticks labels style control.
ticks Axis major and minor ticks style control.
title Axis title.
variable The Variable assigned to this axis.
variable_index Index of the Variable assigned to this axis.

Methods

adjust_range_to_nice() Adjust current range to nice values.
fit_range() Set range of axis to variable minimum and maximum.
fit_range_to_nice() Set range of axis to nice values near variable minimum and maximum.
Cartesian2DFieldAxis.adjust_range_to_nice()

Adjust current range to nice values.

This adjusts the axis label values such that all currently displayed values are set to have the smallest number of significant digits possible:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.adjust_range_to_nice()
Cartesian2DFieldAxis.fit_range()

Set range of axis to variable minimum and maximum.

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range()
Cartesian2DFieldAxis.fit_range_to_nice()

Set range of axis to nice values near variable minimum and maximum.

This method resets the range to equal the minimum and maximum of the data being plotted, but makes the axis values “nice” by setting labels to have the smallest number of significant digits possible. If the axis dependency is not independent then this action may also affect the range on another axis:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range_to_nice()
Cartesian2DFieldAxis.grid_lines

Major grid lines style control.

Type:GridLines

Major grid lines are attached to the locations of the major ticks. See minor_grid_lines for lines attached to minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.grid_lines.show = True
Cartesian2DFieldAxis.line

Axis line style control.

Type:Cartesian2DAxisLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.line_thickness = 0.6
Cartesian2DFieldAxis.log_scale

Use logarithmic scale for this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> # or "plot.axes.r_axis" for the radial axis in polar plots
>>> axis.log_scale = True
Cartesian2DFieldAxis.marker_grid_line

Marker line to indicate a particular position along an axis.

Type:MarkerGridLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.marker_grid_line.show = True
>>> axis.marker_grid_line.position = 0.5
Cartesian2DFieldAxis.max

Upper bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 1.0
Cartesian2DFieldAxis.min

Lower bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.min = 0.0
Cartesian2DFieldAxis.minor_grid_lines

Minor grid lines style control.

Type:MinorGridLines

Minor grid lines are attached to the locations of the minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.minor_grid_lines.show = True
Cartesian2DFieldAxis.reverse

Reverse the direction of the axis scale.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.reverse = True
Cartesian2DFieldAxis.show

Enable drawing of this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.show = True
Cartesian2DFieldAxis.tick_labels

Axis ticks labels style control.

Type:TickLabels2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.tick_labels.show = False
Cartesian2DFieldAxis.ticks

Axis major and minor ticks style control.

Type:Ticks2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.ticks.line_thickness = 0.8
Cartesian2DFieldAxis.title

Axis title.

Type:string

This is the primary label for the axis and usually includes units:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.title.text = 'distance (m)'
Cartesian2DFieldAxis.variable

The Variable assigned to this axis.

Type:Variable

This is the spatial variable associated with this axis and is usually one of (X, Y, Z). Example usage:

>>> import tecplot as tp
>>> fr = tp.active_frame()
>>> ds = fr.dataset
>>> axes = fr.plot().axes
>>> axes.x_axis.variable.name, axes.y_axis.variable.name
('X', 'Y')
>>> axes.x_axis.variable = ds.variable('U')
>>> axes.y_axis.variable = ds.variable('V')
>>> axes.x_axis.variable.name, axes.y_axis.variable.name
('U', 'V')
Cartesian2DFieldAxis.variable_index

Index of the Variable assigned to this axis.

Type:Index (zero-based)

Example usage, interchanging the (x, y) axes:

>>> v0 = plot.axes.x_axis.variable_index
>>> v1 = plot.axes.y_axis.variable_index
>>> plot.axes.x_axis.variable_index = v1
>>> plot.axes.y_axis.variable_index = v0

Cartesian3DFieldAxes

class tecplot.plot.Cartesian3DFieldAxes(plot)[source]

(X, Y, Z) axes style control for 3D field plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Color

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D_Volume', 'sphere.lpk')
dataset = tp.load_layout(infile)

frame = tp.active_frame()
plot = frame.plot()

plot.axes.x_axis.show = True
plot.axes.y_axis.show = True
plot.axes.z_axis.show = True
plot.axes.grid_area.fill_color = Color.SkyBlue
plot.axes.padding = 20

plot.view.fit()

tp.export.save_png('axes_3d.png', 600)
../_images/axes_3d.png

Attributes

aspect_ratio_limit Scale limit of the axes aspect ratio.
aspect_ratio_reset Axes scale aspect ratio used when aspect_ratio_limit is exceeded.
axis_mode Scale dependencies along each axis.
edge_auto_reset Enable automatically choosing which edges to label.
grid_area Area of the viewport used by the axes.
padding Margin of axis padding around data.
preserve_scale Preserve scale (spacing between ticks) on range change.
range_aspect_ratio_limit Range limit of the axes aspect ratio.
range_aspect_ratio_reset Axes range aspect ratio used range_aspect_ratio_limit is exceeded.
viewport Area of the frame used by the plot axes.
x_axis X-axis style control.
xy_ratio X – Y axis scaling ratio.
xz_ratio X – Z axis scaling ratio.
y_axis Y-axis style control.
z_axis Z-axis style control.

Methods

next()
reset_scale() Recalculate the scale factors for each axis.
Cartesian3DFieldAxes.aspect_ratio_limit

Scale limit of the axes aspect ratio.

Type:float

This is the limit above which the axes relative scales will be pegged to aspect_ratio_reset. The following example will set the aspect ratio between scales to 1 if they first exceed a ratio of 10:

>>> plot.axes.aspect_ratio_limit = 10
>>> plot.axes.aspect_ratio_reset = 1
>>> plot.axes.reset_scale()
Cartesian3DFieldAxes.aspect_ratio_reset

Axes scale aspect ratio used when aspect_ratio_limit is exceeded.

Type:float

This is the aspect ratio used to scale the axes when the data’s aspect ratio exceeds the value set to aspect_ratio_limit. The following example will set the aspect ratio between scales to 10 if they first exceed a ratio of 15:

>>> plot.axes.aspect_ratio_limit = 15
>>> plot.axes.aspect_ratio_reset = 10
>>> plot.axes.reset_scale()
Cartesian3DFieldAxes.axis_mode

Scale dependencies along each axis.

Type:AxisMode

Possible values: Independent, XYDependent, XYZDependent.

Dependent mode allows for specifying the axes scaling ratios:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.XYZDependent
>>> plot.axes.xy_ratio = 2
>>> plot.axes.xz_ratio = 20
Cartesian3DFieldAxes.edge_auto_reset

Enable automatically choosing which edges to label.

Type:bool

Example usage:

>>> plot.axes.edge_auto_reset = True
Cartesian3DFieldAxes.grid_area

Area of the viewport used by the axes.

Type:Cartesian3DGridArea

Example usage:

>>> plot.axes.grid_area.fill_color = Color.LightGreen
Cartesian3DFieldAxes.next()
Cartesian3DFieldAxes.padding

Margin of axis padding around data.

Type:float in percent of data extent.

Example usage:

>>> plot.axes.padding = 5
Cartesian3DFieldAxes.preserve_scale

Preserve scale (spacing between ticks) on range change.

Type:boolean

This maintains the axis scaling, i.e. the distance between values along the axis. If False, the axes length will be preserved when the range changes:

>>> plot.axes.preserve_scale = False
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 10 # axis scale is changed (length is preserved)
Cartesian3DFieldAxes.range_aspect_ratio_limit

Range limit of the axes aspect ratio.

Type:float

This is the limit above which the axes’ relative ranges will be pegged to range_aspect_ratio_reset. The following example will set the aspect ratio between ranges to 1 if they first exceed a ratio of 10:

>>> plot.axes.range_aspect_ratio_limit = 10
>>> plot.axes.range_aspect_ratio_reset = 1
>>> plot.axes.reset_ranges()
Cartesian3DFieldAxes.range_aspect_ratio_reset

Axes range aspect ratio used range_aspect_ratio_limit is exceeded.

Type:float

This is the aspect ratio used to set the ranges of the axes when the axes’ aspect ratios exceed the value of range_aspect_ratio_limit. The following example will set the aspect ratio between ranges to 10 if they first exceed a ratio of 15:

>>> plot.axes.range_aspect_ratio_limit = 15
>>> plot.axes.range_aspect_ratio_reset = 10
>>> plot.axes.reset_ranges()
Cartesian3DFieldAxes.reset_scale()

Recalculate the scale factors for each axis.

Aspect ratio limits are taken into account:

>>> plot.axes.reset_scale()
Cartesian3DFieldAxes.viewport

Area of the frame used by the plot axes.

Type:ReadOnlyViewport

Example usage:

>>> print(plot.axes.viewport.bottom)
5
Cartesian3DFieldAxes.x_axis

X-axis style control.

Type:Cartesian3DFieldAxis

Example usage:

>>> plot.axes.x_axis.show = True
Cartesian3DFieldAxes.xy_ratio

X – Y axis scaling ratio.

Type:float in percent

This requires the axes to be in dependent mode:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.XYDependent
>>> plot.axes.xy_ratio = 2
Cartesian3DFieldAxes.xz_ratio

X – Z axis scaling ratio.

Type:float in percent

This requires the axes to be in dependent mode:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.XYZDependent
>>> plot.axes.xy_ratio = 2
>>> plot.axes.xz_ratio = 20
Cartesian3DFieldAxes.y_axis

Y-axis style control.

Type:Cartesian3DFieldAxis

Example usage:

>>> plot.axes.y_axis.show = True
Cartesian3DFieldAxes.z_axis

Z-axis style control.

Type:Cartesian3DFieldAxis

Example usage:

>>> plot.axes.z_axis.show = True

Cartesian3DFieldAxis

class tecplot.plot.Cartesian3DFieldAxis(axes, name, **kwargs)[source]

X, Y or Z axis on 3D field plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Color, AxisLine3DAssignment

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D_Volume', 'waveintensity.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian3D)
plot.activate()

plot.show_contour = True

contour = plot.contour(0)
contour.variable = dataset.variable('INTENS')
contour.colormap_name = 'Sequential - Yellow/Green/Blue'
contour.legend.show = False
plot.axes.grid_area.fill_color = None

txt = next(frame.texts())
txt.color = Color.Red
txt.size = 18
txt.anchor_position = 1.5, 95

axes = [plot.axes.x_axis, plot.axes.y_axis, plot.axes.z_axis]
assignments = [AxisLine3DAssignment.YMinZMax,
               AxisLine3DAssignment.ZMaxXMin,
               AxisLine3DAssignment.XMaxYMin]

for ax, asgn in zip(axes, assignments):
    ax.show = True
    ax.grid_lines.show = False
    ax.title.show = False
    ax.line.show = False
    ax.line.edge_assignment = asgn

plot.axes.z_axis.grid_lines.show = True

plot.view.fit()

tp.export.save_png('axis_3d.png', 600)
../_images/axis_3d.png

Attributes

grid_lines Major grid lines style control.
line Axis line style control.
marker_grid_line Marker line to indicate a particular position along an axis.
max Upper bound of this axis’ range.
min Lower bound of this axis’ range.
minor_grid_lines Minor grid lines style control.
scale_factor Factor used for axis scaling.
show Enable drawing of this axis.
tick_labels Axis ticks labels style control.
ticks Axis major and minor ticks style control.
title Axis title.
variable The Variable assigned to this axis.
variable_index Index of the Variable assigned to this axis.

Methods

adjust_range_to_nice() Adjust current range to nice values.
fit_range() Set range of axis to variable minimum and maximum.
fit_range_to_nice() Set range of axis to nice values near variable minimum and maximum.
Cartesian3DFieldAxis.adjust_range_to_nice()

Adjust current range to nice values.

This adjusts the axis label values such that all currently displayed values are set to have the smallest number of significant digits possible:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.adjust_range_to_nice()
Cartesian3DFieldAxis.fit_range()

Set range of axis to variable minimum and maximum.

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range()
Cartesian3DFieldAxis.fit_range_to_nice()

Set range of axis to nice values near variable minimum and maximum.

This method resets the range to equal the minimum and maximum of the data being plotted, but makes the axis values “nice” by setting labels to have the smallest number of significant digits possible. If the axis dependency is not independent then this action may also affect the range on another axis:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range_to_nice()
Cartesian3DFieldAxis.grid_lines

Major grid lines style control.

Type:GridLines

Major grid lines are attached to the locations of the major ticks. See minor_grid_lines for lines attached to minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.grid_lines.show = True
Cartesian3DFieldAxis.line

Axis line style control.

Type:AxisLine3D

Example usage:

>>> plot.axes.x_axis.line.line_thickness = 0.6
Cartesian3DFieldAxis.marker_grid_line

Marker line to indicate a particular position along an axis.

Type:MarkerGridLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.marker_grid_line.show = True
>>> axis.marker_grid_line.position = 0.5
Cartesian3DFieldAxis.max

Upper bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 1.0
Cartesian3DFieldAxis.min

Lower bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.min = 0.0
Cartesian3DFieldAxis.minor_grid_lines

Minor grid lines style control.

Type:MinorGridLines

Minor grid lines are attached to the locations of the minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.minor_grid_lines.show = True
Cartesian3DFieldAxis.scale_factor

Factor used for axis scaling.

Type:float

This will automatically scale the other axes if axis mode dependent. Setting the axis mode to independent allows each axis to have their own scale factor:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.Independent
>>> plot.axes.x_axis.scale_factor = 1
>>> plot.axes.y_axis.scale_factor = 2
>>> plot.axes.z_axis.scale_factor = 3
Cartesian3DFieldAxis.show

Enable drawing of this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.show = True
Cartesian3DFieldAxis.tick_labels

Axis ticks labels style control.

Type:TickLabels3D

Example usage:

>>> plot.axes.x_axis.tick_labels.show = False
Cartesian3DFieldAxis.ticks

Axis major and minor ticks style control.

Type:Ticks3D

Example usage:

>>> plot.axes.x_axis.ticks.line_thickness = 0.8
Cartesian3DFieldAxis.title

Axis title.

Type:string

This is the primary label for the axis and usually includes units:

>>> plot.axes.x_axis.title.text = 'distance (m)'
Cartesian3DFieldAxis.variable

The Variable assigned to this axis.

Type:Variable

This is the spatial variable associated with this axis and is usually one of (X, Y, Z). Example usage:

>>> import tecplot as tp
>>> fr = tp.active_frame()
>>> ds = fr.dataset
>>> axes = fr.plot().axes
>>> axes.x_axis.variable.name, axes.y_axis.variable.name
('X', 'Y')
>>> axes.x_axis.variable = ds.variable('U')
>>> axes.y_axis.variable = ds.variable('V')
>>> axes.x_axis.variable.name, axes.y_axis.variable.name
('U', 'V')
Cartesian3DFieldAxis.variable_index

Index of the Variable assigned to this axis.

Type:Index (zero-based)

Example usage, interchanging the (x, y) axes:

>>> v0 = plot.axes.x_axis.variable_index
>>> v1 = plot.axes.y_axis.variable_index
>>> plot.axes.x_axis.variable_index = v1
>>> plot.axes.y_axis.variable_index = v0

Line Axes

XYLineAxes

class tecplot.plot.XYLineAxes(plot)[source]

(X, Y) axes style control for line plots.

The axes property of a XYLinePlot allows access to the several x and y axes by index. Linemaps can use any of the five such axes. In this example, we create two sets of data with different scales and the second y-axis is used on the right side of the plot:

import numpy as np
import tecplot as tp
from tecplot.constant import PlotType, Color

frame = tp.active_frame()

npoints = 100
x = np.linspace(-10,10,npoints)
t = x**2
p = 0.1 * np.sin(x)

dataset = frame.create_dataset('data', ['Position (m)', 'Temperature (K)',
                                        'Pressure (Pa)'])
zone = dataset.add_ordered_zone('zone', (100,))
zone.variable('Position (m)')[:] = x
zone.variable('Temperature (K)')[:] = t
zone.variable('Pressure (Pa)')[:] = p

plot = frame.plot(PlotType.XYLine)
plot.activate()
plot.delete_linemaps()

temp = plot.add_linemap('temp', zone, dataset.variable('Position (m)'),
                 dataset.variable('Temperature (K)'))
press = plot.add_linemap('press', zone, dataset.variable('Position (m)'),
                         dataset.variable('Pressure (Pa)'))

# Color the line and the y-axis for temperature
temp.line.color = Color.RedOrange
temp.line.line_thickness = 0.8

ax = plot.axes.y_axis(0)
ax.line.color = temp.line.color
ax.tick_labels.color = temp.line.color
ax.title.color = temp.line.color

# set pressure linemap to second x-axis
press.y_axis_index = 1

# Color the line and the y-axis for pressure
press.line.color = Color.Chartreuse
press.line.line_thickness = 0.8

ax = plot.axes.y_axis(1)
ax.line.color = press.line.color
ax.tick_labels.color = press.line.color
ax.title.color = press.line.color

tp.export.save_png('axes_line.png', 600)
../_images/axes_line.png

Attributes

auto_adjust_ranges Automatically adjust axis ranges to nice values.
axis_mode Scale dependencies along each axis.
grid_area Area bounded by the axes.
precise_grid Precise dot grid.
preserve_scale Preserve scale (spacing between ticks) on range change.
viewport Area of the frame used by the plot axes.
xy_ratio X – Y axis scaling ratio.

Methods

next()
x_axis(index) X-axis style control.
y_axis(index) Y-axis style control.
XYLineAxes.auto_adjust_ranges

Automatically adjust axis ranges to nice values.

Type:boolean

Axes limits will be adjusted to have the smallest number of significant digits possible:

>>> plot.axes.auto_adjust_ranges = False
XYLineAxes.axis_mode

Scale dependencies along each axis.

Type:AxisMode

Possible values: Independent, XYDependent.

Example usage:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.Independent
XYLineAxes.grid_area

Area bounded by the axes.

Type:GridArea

This controls the background color and border of the axes:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.fill_color = Color.LightGreen
XYLineAxes.next()
XYLineAxes.precise_grid

Precise dot grid.

Type:PreciseGrid

This is a set of small dots drawn at the intersection of every minor gridline. In line plots, the axis assignments for the first active mapping govern the precise dot grid. The precise dot grid option is disabled for the 3D Cartesian plots and Line plots when either axis for the first active line mapping uses a log scale:

>>> plot.axes.precise_grid.show = True
XYLineAxes.preserve_scale

Preserve scale (spacing between ticks) on range change.

Type:boolean

This maintains the axis scaling, i.e. the distance between values along the axis. If False, the axes length will be preserved when the range changes:

>>> plot.axes.preserve_scale = False
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 10 # axis scale is changed (length is preserved)
XYLineAxes.viewport

Area of the frame used by the plot axes.

Type:Cartesian2DViewport

Example usage:

>>> plot.axes.viewport.left = 5
>>> plot.axes.viewport.right = 95
>>> plot.axes.viewport.top = 95
>>> plot.axes.viewport.bottom = 5
XYLineAxes.x_axis(index)[source]

X-axis style control.

Type:XYLineAxis

There are five x-axes for each XYLinePlot, indexed from 0 to 4 inclusive:

>>> plot.axes.x_axis(0).show = True
XYLineAxes.xy_ratio

X – Y axis scaling ratio.

Type:float in percent

This requires the axes to be in dependent mode:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.XYDependent
>>> plot.axes.xy_ratio = 2
XYLineAxes.y_axis(index)[source]

Y-axis style control.

Type:XYLineAxis

There are five y-axes for each XYLinePlot, indexed from 0 to 4 inclusive:

>>> plot.axes.y_axis(0).show = True

XYLineAxis

class tecplot.plot.XYLineAxis(axes, name, index)[source]

X or Y axis for line plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, AxisAlignment

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, 'XY', 'y_axis2.plt')
dataset = tp.data.load_tecplot(infile)

plot = tp.active_frame().plot(PlotType.XYLine)
plot.activate()

plot.axes.viewport.left = 25
plot.axes.viewport.right = 75

# set position of the y axes based on viewport width
viewport_width = plot.axes.viewport.right - plot.axes.viewport.left

for i, pos in enumerate([-25,0,100,125]):
    lmap = plot.linemap(i)
    lmap.show = True
    lmap.line.line_thickness = 0.6
    lmap.y_axis_index = i

    yax = plot.axes.y_axis(i)
    yax.line.alignment = AxisAlignment.WithGridMin
    yax.line.color = lmap.line.color
    yax.title.color = lmap.line.color
    yax.tick_labels.color = lmap.line.color

    # convert position in viewport width units to offset in frame width units
    yax.line.offset = -pos * (viewport_width / 100)

tp.export.save_png('axis_line.png', 600)
../_images/axis_line.png

Attributes

grid_lines Major grid lines style control.
line Axis line style control.
log_scale Use logarithmic scale for this axis.
marker_grid_line Marker line to indicate a particular position along an axis.
max Upper bound of this axis’ range.
min Lower bound of this axis’ range.
minor_grid_lines Minor grid lines style control.
reverse Reverse the direction of the axis scale.
show Enable drawing of this axis.
tick_labels Axis ticks labels style control.
ticks Axis major and minor ticks style control.
title Axis title.

Methods

adjust_range_to_nice() Adjust current range to nice values.
fit_range() Set range of axis to variable minimum and maximum.
fit_range_to_nice() Set range of axis to nice values near variable minimum and maximum.
XYLineAxis.adjust_range_to_nice()

Adjust current range to nice values.

This adjusts the axis label values such that all currently displayed values are set to have the smallest number of significant digits possible:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.adjust_range_to_nice()
XYLineAxis.fit_range()

Set range of axis to variable minimum and maximum.

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range()
XYLineAxis.fit_range_to_nice()

Set range of axis to nice values near variable minimum and maximum.

This method resets the range to equal the minimum and maximum of the data being plotted, but makes the axis values “nice” by setting labels to have the smallest number of significant digits possible. If the axis dependency is not independent then this action may also affect the range on another axis:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range_to_nice()
XYLineAxis.grid_lines

Major grid lines style control.

Type:GridLines

Major grid lines are attached to the locations of the major ticks. See minor_grid_lines for lines attached to minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.grid_lines.show = True
XYLineAxis.line

Axis line style control.

Type:Cartesian2DAxisLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.line_thickness = 0.6
XYLineAxis.log_scale

Use logarithmic scale for this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> # or "plot.axes.r_axis" for the radial axis in polar plots
>>> axis.log_scale = True
XYLineAxis.marker_grid_line

Marker line to indicate a particular position along an axis.

Type:MarkerGridLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.marker_grid_line.show = True
>>> axis.marker_grid_line.position = 0.5
XYLineAxis.max

Upper bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 1.0
XYLineAxis.min

Lower bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.min = 0.0
XYLineAxis.minor_grid_lines

Minor grid lines style control.

Type:MinorGridLines

Minor grid lines are attached to the locations of the minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.minor_grid_lines.show = True
XYLineAxis.reverse

Reverse the direction of the axis scale.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.reverse = True
XYLineAxis.show

Enable drawing of this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.show = True
XYLineAxis.tick_labels

Axis ticks labels style control.

Type:TickLabels2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.tick_labels.show = False
XYLineAxis.ticks

Axis major and minor ticks style control.

Type:Ticks2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.ticks.line_thickness = 0.8
XYLineAxis.title

Axis title.

Type:string

This is the primary label for the axis and usually includes units:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.title.text = 'distance (m)'

PolarLineAxes

class tecplot.plot.PolarLineAxes(plot)[source]

(R, Theta) axes style control for polar plots.

Example usage:

import numpy as np
import tecplot as tp
from tecplot.constant import PlotType, ThetaMode

frame = tp.active_frame()

npoints = 300
r = np.linspace(0, 2000, npoints)
theta = np.linspace(0, 10, npoints)

dataset = frame.create_dataset('Data', ['R', 'Theta'])
zone = dataset.add_ordered_zone('Zone', (300,))
zone.variable('R')[:] = r
zone.variable('Theta')[:] = theta

plot = frame.plot(PlotType.PolarLine)
plot.activate()

plot.axes.r_axis.max = np.max(r)
plot.axes.theta_axis.mode = ThetaMode.Radians

plot.delete_linemaps()
lmap = plot.add_linemap('Linemap', zone, dataset.variable('R'),
                        dataset.variable('Theta'))
lmap.line.line_thickness = 0.8

plot.view.fit()

tp.export.save_png('axes_polar.png', 600)
../_images/axes_polar.png

Attributes

grid_area Area bounded by the axes.
precise_grid Precise dot grid.
preserve_scale Preserve scale (spacing between ticks) on range change.
r_axis Radial axis style control.
theta_axis Polar-angle axis style control.
viewport Area of the frame used by the plot axes outside the grid area.

Methods

next()
PolarLineAxes.grid_area

Area bounded by the axes.

Type:GridArea

This controls the background color and border of the axes:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.fill_color = Color.LightGreen
PolarLineAxes.next()
PolarLineAxes.precise_grid

Precise dot grid.

Type:PreciseGrid

This is a set of small dots drawn at the intersection of every minor gridline. In line plots, the axis assignments for the first active mapping govern the precise dot grid. The precise dot grid option is disabled for the 3D Cartesian plots and Line plots when either axis for the first active line mapping uses a log scale:

>>> plot.axes.precise_grid.show = True
PolarLineAxes.preserve_scale

Preserve scale (spacing between ticks) on range change.

Type:boolean

This maintains the axis scaling, i.e. the distance between values along the axis. If False, the axes length will be preserved when the range changes:

>>> plot.axes.preserve_scale = False
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 10 # axis scale is changed (length is preserved)
PolarLineAxes.r_axis

Radial axis style control.

Type:RadialLineAxis

Example usage:

>>> plot.axes.r_axis.title.text = 'R (meters)'
PolarLineAxes.theta_axis

Polar-angle axis style control.

Type:PolarAngleLineAxis

Example usage:

>>> plot.axes.theta_axis.title.text = 'Theta (radians)'
PolarLineAxes.viewport

Area of the frame used by the plot axes outside the grid area.

Type:PolarViewport

Example usage:

>>> from tecplot.constant import Color
>>> plot.axes.viewport.fill_color = Color.LightGreen

RadialLineAxis

class tecplot.plot.RadialLineAxis(axes)[source]

The R axis for polar plots

See the example shown for the theta axis.

Attributes

grid_lines Major grid lines style control.
line Radial axis line style control.
log_scale Use logarithmic scale for this axis.
marker_grid_line Marker line to indicate a particular position along an axis.
max Upper bound of this axis’ range.
min Lower bound of this axis’ range.
minor_grid_lines Minor grid lines style control.
origin Value at the origin of the axis.
reverse Reverse the direction of the axis scale.
show Enable drawing of this axis.
tick_labels Axis ticks labels style control.
ticks Axis major and minor ticks style control.
title Axis title.

Methods

adjust_range_to_nice() Adjust current range to nice values.
fit_range() Set range of axis to variable minimum and maximum.
fit_range_to_nice() Set range of axis to nice values near variable minimum and maximum.
RadialLineAxis.adjust_range_to_nice()

Adjust current range to nice values.

This adjusts the axis label values such that all currently displayed values are set to have the smallest number of significant digits possible:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.adjust_range_to_nice()
RadialLineAxis.fit_range()

Set range of axis to variable minimum and maximum.

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range()
RadialLineAxis.fit_range_to_nice()

Set range of axis to nice values near variable minimum and maximum.

This method resets the range to equal the minimum and maximum of the data being plotted, but makes the axis values “nice” by setting labels to have the smallest number of significant digits possible. If the axis dependency is not independent then this action may also affect the range on another axis:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range_to_nice()
RadialLineAxis.grid_lines

Major grid lines style control.

Type:GridLines

Major grid lines are attached to the locations of the major ticks. See minor_grid_lines for lines attached to minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.grid_lines.show = True
RadialLineAxis.line

Radial axis line style control.

Type:RadialAxisLine2D

Example usage:

>>> plot.axes.r_axis.line.line_thickness = 0.6
RadialLineAxis.log_scale

Use logarithmic scale for this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> # or "plot.axes.r_axis" for the radial axis in polar plots
>>> axis.log_scale = True
RadialLineAxis.marker_grid_line

Marker line to indicate a particular position along an axis.

Type:MarkerGridLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.marker_grid_line.show = True
>>> axis.marker_grid_line.position = 0.5
RadialLineAxis.max

Upper bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 1.0
RadialLineAxis.min

Lower bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.min = 0.0
RadialLineAxis.minor_grid_lines

Minor grid lines style control.

Type:MinorGridLines

Minor grid lines are attached to the locations of the minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.minor_grid_lines.show = True
RadialLineAxis.origin

Value at the origin of the axis.

Type:float

Example usage:

# value at center of plot equal to 10
>>> plot.axes.r_axis.origin = 10
# rotate theta axis 45 degrees clockwise
>>> plot.axes.theta_axis.origin = 45
RadialLineAxis.reverse

Reverse the direction of the axis scale.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.reverse = True
RadialLineAxis.show

Enable drawing of this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.show = True
RadialLineAxis.tick_labels

Axis ticks labels style control.

Type:RadialTickLabels

Example usage:

>>> plot.axes.r_axis.tick_labels.show = False
RadialLineAxis.ticks

Axis major and minor ticks style control.

Type:RadialTicks

Example usage:

>>> plot.axes.r_axis.ticks.line_thickness = 0.8
RadialLineAxis.title

Axis title.

Type:string

This is the primary label for the axis and usually includes units:

>>> plot.axes.r_axis.title.text = 'distance (m)'

PolarAngleLineAxis

class tecplot.plot.PolarAngleLineAxis(axes)[source]

Theta axis for polar plots.

This example manipulates both the theta and radial axes to produce a star plot. Custom labels are created for each data point:

import numpy as np
import tecplot as tp
from tecplot.constant import PlotType, ThetaMode, NumberFormat, AxisAlignment

np.random.seed(2)
npoints = 7
theta = np.linspace(0, npoints, npoints+1)

frame = tp.active_frame()
dataset = frame.create_dataset('Data', ['Magnitude', 'Property'])

for i in range(3):
    r = list(np.random.uniform(0.01, 0.99, npoints))
    r.append(r[0])
    zone = dataset.add_ordered_zone('Zone {}'.format(i), (npoints+1,))
    zone.variable('Magnitude')[:] = r
    zone.variable('Property')[:] = theta

plot = frame.plot(PlotType.PolarLine)
plot.activate()
plot.delete_linemaps()

for i, zone in enumerate(dataset.zones()):
    lmap = plot.add_linemap('Linemap {}'.format(i), zone,
                            dataset.variable('Magnitude'),
                            dataset.variable('Property'))
    lmap.line.line_thickness = 0.8

r_axis = plot.axes.r_axis
r_axis.max = 1
r_axis.line.show = False
r_axis.title.position = 85
r_axis.line.alignment = AxisAlignment.WithOpposingAxisValue
r_axis.line.opposing_axis_value = 1

theta_axis = plot.axes.theta_axis
theta_axis.origin = 1
theta_axis.mode = ThetaMode.Arbitrary
theta_axis.min = 0
theta_axis.max = theta.max()
theta_axis.period = npoints
theta_axis.ticks.spacing = 1
theta_axis.ticks.minor_num_ticks = 0
theta_axis.title.show = False

theta_labels = theta_axis.tick_labels.format
theta_labels.format_type = NumberFormat.CustomLabel
theta_labels.add_custom_labels('A', 'B', 'C', 'D', 'E', 'F', 'G')
theta_labels.custom_labels_index = 0

plot.view.fit()

tp.export.save_png('star_plot.png', 600)
../_images/star_plot.png

Attributes

grid_lines
line Axis line style control.
marker_grid_line Marker line to indicate a particular position along an axis.
max Upper bound of this axis’ range.
min Lower bound of this axis’ range.
minor_grid_lines
mode Units or scale used for the theta axis.
origin Value at the origin of the axis.
period Number of (min, max) cycles to include in 360 degrees.
reverse Reverse the direction of the axis scale.
show Enable drawing of this axis.
tick_labels Axis ticks labels style control.
ticks Axis major and minor ticks style control.
title Axis title.

Methods

adjust_range_to_nice() Adjust current range to nice values.
fit_range() Set range of axis to variable minimum and maximum.
fit_range_to_nice() Set range of axis to nice values near variable minimum and maximum.
set_range_to_entire_circle() Set theta range to entire circle.
PolarAngleLineAxis.adjust_range_to_nice()

Adjust current range to nice values.

This adjusts the axis label values such that all currently displayed values are set to have the smallest number of significant digits possible:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.adjust_range_to_nice()
PolarAngleLineAxis.fit_range()

Set range of axis to variable minimum and maximum.

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range()
PolarAngleLineAxis.fit_range_to_nice()

Set range of axis to nice values near variable minimum and maximum.

This method resets the range to equal the minimum and maximum of the data being plotted, but makes the axis values “nice” by setting labels to have the smallest number of significant digits possible. If the axis dependency is not independent then this action may also affect the range on another axis:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range_to_nice()
PolarAngleLineAxis.grid_lines
PolarAngleLineAxis.line

Axis line style control.

Type:AxisLine2D

Example usage:

>>> plot.axes.r_axis.line.line_thickness = 0.6
>>> plot.axes.theta_axis.line.line_thickness = 0.6
PolarAngleLineAxis.marker_grid_line

Marker line to indicate a particular position along an axis.

Type:MarkerGridLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.marker_grid_line.show = True
>>> axis.marker_grid_line.position = 0.5
PolarAngleLineAxis.max

Upper bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 1.0
PolarAngleLineAxis.min

Lower bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.min = 0.0
PolarAngleLineAxis.minor_grid_lines
PolarAngleLineAxis.mode

Units or scale used for the theta axis.

Type:ThetaMode

Possible values: ThetaMode.Degrees, ThetaMode.Radians, ThetaMode.Arbitrary.

Example usage:

>>> from tecplot.constant import ThetaMode
>>> plot.axes.theta_axis.mode = ThetaMode.Radians
PolarAngleLineAxis.origin

Value at the origin of the axis.

Type:float

Example usage:

# value at center of plot equal to 10
>>> plot.axes.r_axis.origin = 10
# rotate theta axis 45 degrees clockwise
>>> plot.axes.theta_axis.origin = 45
PolarAngleLineAxis.period

Number of (min, max) cycles to include in 360 degrees.

Type:float

Example usage:

>>> plot.axes.theta_axis.period = 2
PolarAngleLineAxis.reverse

Reverse the direction of the axis scale.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.reverse = True
PolarAngleLineAxis.set_range_to_entire_circle()[source]

Set theta range to entire circle.

Example usage:

>>> plot.axes.theta_axis.set_range_to_entire_circle()
PolarAngleLineAxis.show

Enable drawing of this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.show = True
PolarAngleLineAxis.tick_labels

Axis ticks labels style control.

Type:TickLabels2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.tick_labels.show = False
PolarAngleLineAxis.ticks

Axis major and minor ticks style control.

Type:Ticks2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.ticks.line_thickness = 0.8
PolarAngleLineAxis.title

Axis title.

Type:string

This is the primary label for the axis and usually includes units:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.title.text = 'distance (m)'

Sketch Axes

SketchAxes

class tecplot.plot.SketchAxes(plot)[source]

(X, Y) axes style control for sketch plots.

Sketch plots have cartesian x and y axes which can be adjusted using the viewport:

import tecplot as tp
from tecplot.constant import PlotType

frame = tp.active_frame()
plot = frame.plot(PlotType.Sketch)

plot.axes.x_axis.show = True
plot.axes.y_axis.show = True

plot.axes.viewport.left = 10
plot.axes.viewport.right = 90
plot.axes.viewport.bottom = 10
plot.axes.viewport.top = 90

tp.export.save_png('axes_sketch.png', 600)
../_images/axes_sketch.png

Attributes

auto_adjust_ranges Automatically adjust axis ranges to nice values.
axis_mode Scale dependencies along each axis.
grid_area Area bounded by the axes.
precise_grid Precise dot grid.
preserve_scale Preserve scale (spacing between ticks) on range change.
viewport Area of the frame used by the plot axes.
x_axis X-axis style control.
xy_ratio X – Y axis scaling ratio.
y_axis Y-axis style control.

Methods

next()
SketchAxes.auto_adjust_ranges

Automatically adjust axis ranges to nice values.

Type:boolean

Axes limits will be adjusted to have the smallest number of significant digits possible:

>>> plot.axes.auto_adjust_ranges = False
SketchAxes.axis_mode

Scale dependencies along each axis.

Type:AxisMode

Possible values: Independent, XYDependent.

Example usage:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.Independent
SketchAxes.grid_area

Area bounded by the axes.

Type:GridArea

This controls the background color and border of the axes:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.fill_color = Color.LightGreen
SketchAxes.next()
SketchAxes.precise_grid

Precise dot grid.

Type:PreciseGrid

This is a set of small dots drawn at the intersection of every minor gridline. In line plots, the axis assignments for the first active mapping govern the precise dot grid. The precise dot grid option is disabled for the 3D Cartesian plots and Line plots when either axis for the first active line mapping uses a log scale:

>>> plot.axes.precise_grid.show = True
SketchAxes.preserve_scale

Preserve scale (spacing between ticks) on range change.

Type:boolean

This maintains the axis scaling, i.e. the distance between values along the axis. If False, the axes length will be preserved when the range changes:

>>> plot.axes.preserve_scale = False
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 10 # axis scale is changed (length is preserved)
SketchAxes.viewport

Area of the frame used by the plot axes.

Type:Cartesian2DViewport

Example usage:

>>> plot.axes.viewport.left = 5
>>> plot.axes.viewport.right = 95
>>> plot.axes.viewport.top = 95
>>> plot.axes.viewport.bottom = 5
SketchAxes.x_axis

X-axis style control.

Type:SketchAxis

Example usage:

>>> plot.axes.x_axis.show = True
SketchAxes.xy_ratio

X – Y axis scaling ratio.

Type:float in percent

This requires the axes to be in dependent mode:

>>> from tecplot.constant import AxisMode
>>> plot.axes.axis_mode = AxisMode.XYDependent
>>> plot.axes.xy_ratio = 2
SketchAxes.y_axis

Y-axis style control.

Type:SketchAxis

Example usage:

>>> plot.axes.y_axis.show = True

SketchAxis

class tecplot.plot.SketchAxis(axes, name, **kwargs)[source]

X or Y axis for sketch plots.

import tecplot as tp
from tecplot.constant import PlotType

plot = tp.active_frame().plot(PlotType.Sketch)

viewport = plot.axes.viewport
viewport.left = 10
viewport.right = 90
viewport.bottom = 10

xaxis = plot.axes.x_axis
xaxis.show = True
xaxis.min = 0
xaxis.max = 360
xaxis.title.text = 'Angle (Degrees)'

xaxis.ticks.spacing = 60

tp.export.save_png('axis_sketch.png', 600)
../_images/axis_sketch.png

Attributes

grid_lines Major grid lines style control.
line Axis line style control.
log_scale Use logarithmic scale for this axis.
marker_grid_line Marker line to indicate a particular position along an axis.
max Upper bound of this axis’ range.
min Lower bound of this axis’ range.
minor_grid_lines Minor grid lines style control.
show Enable drawing of this axis.
tick_labels Axis ticks labels style control.
ticks Axis major and minor ticks style control.
title Axis title.

Methods

adjust_range_to_nice() Adjust current range to nice values.
fit_range() Set range of axis to variable minimum and maximum.
fit_range_to_nice() Set range of axis to nice values near variable minimum and maximum.
SketchAxis.adjust_range_to_nice()

Adjust current range to nice values.

This adjusts the axis label values such that all currently displayed values are set to have the smallest number of significant digits possible:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.adjust_range_to_nice()
SketchAxis.fit_range()

Set range of axis to variable minimum and maximum.

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range()
SketchAxis.fit_range_to_nice()

Set range of axis to nice values near variable minimum and maximum.

This method resets the range to equal the minimum and maximum of the data being plotted, but makes the axis values “nice” by setting labels to have the smallest number of significant digits possible. If the axis dependency is not independent then this action may also affect the range on another axis:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.fit_range_to_nice()
SketchAxis.grid_lines

Major grid lines style control.

Type:GridLines

Major grid lines are attached to the locations of the major ticks. See minor_grid_lines for lines attached to minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.grid_lines.show = True
SketchAxis.line

Axis line style control.

Type:Cartesian2DAxisLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.line_thickness = 0.6
SketchAxis.log_scale

Use logarithmic scale for this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> # or "plot.axes.r_axis" for the radial axis in polar plots
>>> axis.log_scale = True
SketchAxis.marker_grid_line

Marker line to indicate a particular position along an axis.

Type:MarkerGridLine

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.marker_grid_line.show = True
>>> axis.marker_grid_line.position = 0.5
SketchAxis.max

Upper bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.max = 1.0
SketchAxis.min

Lower bound of this axis’ range.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.min = 0.0
SketchAxis.minor_grid_lines

Minor grid lines style control.

Type:MinorGridLines

Minor grid lines are attached to the locations of the minor ticks. Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.minor_grid_lines.show = True
SketchAxis.show

Enable drawing of this axis.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.show = True
SketchAxis.tick_labels

Axis ticks labels style control.

Type:TickLabels2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.tick_labels.show = False
SketchAxis.ticks

Axis major and minor ticks style control.

Type:Ticks2D

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.ticks.line_thickness = 0.8
SketchAxis.title

Axis title.

Type:string

This is the primary label for the axis and usually includes units:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.title.text = 'distance (m)'

Axis Elements

Axis Line

AxisLine2D

class tecplot.plot.AxisLine2D(axis)[source]

Graduated axis line for 2D plots.

Cartesian (x, y) plots use an extension of this class (Cartesian2DAxisLine). Polar plots use this class directly. Example usage:

from os import path
import tecplot as tp
from tecplot.tecutil import sv
from tecplot.constant import PlotType, Color, AxisAlignment

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '2D', 'polarplot.plt')
dataset = tp.data.load_tecplot(infile)

plot = tp.active_frame().plot(PlotType.Cartesian2D)
plot.activate()

plot.show_contour = True
plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'

plot.axes.preserve_scale = True
plot.axes.x_axis.fit_range()
xmin, xmax = plot.axes.x_axis.min, plot.axes.x_axis.max

xline = plot.axes.x_axis.line
xline.color = Color.DeepRed
xline.alignment = AxisAlignment.WithOpposingAxisValue
xline.opposing_axis_value = 0

yline = plot.axes.y_axis.line
yline.color = Color.DeepRed
yline.alignment = AxisAlignment.WithOpposingAxisValue
yline.opposing_axis_value = 0

fr = tp.active_page().add_frame()
polar_plot = fr.plot(PlotType.PolarLine)
polar_plot.activate()

fr.transparent = True
polar_plot.delete_linemaps()

# these values obtained using 360 EX interactively
tp.session.set_style(-2.30, sv.POLARVIEW, sv.EXTENTS, sv.X1)
tp.session.set_style( 2.57, sv.POLARVIEW, sv.EXTENTS, sv.X2)
tp.session.set_style(-2.14, sv.POLARVIEW, sv.EXTENTS, sv.Y1)
tp.session.set_style( 2.17, sv.POLARVIEW, sv.EXTENTS, sv.Y2)

polar_plot.axes.r_axis.show = False
polar_plot.axes.r_axis.min = 0.83

tp.export.save_png('axis_line_2d.png', 600)
../_images/axis_line_2d.png

Attributes

alignment Axis line placement.
color Color of the axis line.
line_thickness Width of the axis line to be drawn.
offset Axis line placement with respect to the grid border.
opposing_axis_value Axis line placement with respect to the opposing axis.
show Draw the primary axis line on the plot.
AxisLine2D.alignment

Axis line placement.

Type:AxisAlignment

Possible values: WithViewport, WithOpposingAxisValue, WithGridMin, WithGridMax, WithSpecificAngle, WithGridAreaTop, WithGridAreaBottom, WithGridAreaLeft or WithGridAreaRight.

Not all values will be available for every plot type. Example usage:

>>> from tecplot.constant import AxisAlignment
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.alignment = AxisAlignment.WithGridMin
AxisLine2D.color

Color of the axis line.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.color = Color.Blue
AxisLine2D.line_thickness

Width of the axis line to be drawn.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.line_thickness = 0.5
AxisLine2D.offset

Axis line placement with respect to the grid border.

Type:float (percent of frame height)

This is the offset from the grid border-aligned position dictated by properties such as AxisLine2D.alignment. The example moves the axis line into the plot by 5% of the frame height:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.offset = -5
AxisLine2D.opposing_axis_value

Axis line placement with respect to the opposing axis.

Type:float

The axis alignment must be set to AxisAlignment.WithOpposingAxisValue to make this property relevant:

>>> from tecplot.constant import AxisAlignment
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.alignment = AxisAlignment.WithOpposingAxisValue
>>> axis.line.opposing_axis_value = 0.5
AxisLine2D.show

Draw the primary axis line on the plot.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.show = False

Cartesian2DAxisLine

class tecplot.plot.Cartesian2DAxisLine(axis)[source]

Axis line for 2D field plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Color, AxisAlignment

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '2D', 'polarplot.plt')
dataset = tp.data.load_tecplot(infile)

plot = tp.active_frame().plot(PlotType.Cartesian2D)
plot.activate()

plot.show_contour = True
plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'

plot.axes.preserve_scale = True
plot.axes.x_axis.fit_range()

xline = plot.axes.x_axis.line
xline.color = Color.DeepRed
xline.alignment = AxisAlignment.WithOpposingAxisValue
xline.opposing_axis_value = 0

yline = plot.axes.y_axis.line
yline.color = Color.DeepRed
yline.alignment = AxisAlignment.WithOpposingAxisValue
yline.opposing_axis_value = 0

tp.export.save_png('axis_line_cartesian2d.png', 600)
../_images/axis_line_cartesian2d.png

Attributes

alignment Axis line placement.
color Color of the axis line.
line_thickness Width of the axis line to be drawn.
offset Axis line placement with respect to the grid border.
opposing_axis_value Axis line placement with respect to the opposing axis.
position Axis line placement with respect to the viewport.
show Draw the primary axis line on the plot.
Cartesian2DAxisLine.alignment

Axis line placement.

Type:AxisAlignment

Possible values: WithViewport, WithOpposingAxisValue, WithGridMin, WithGridMax, WithSpecificAngle, WithGridAreaTop, WithGridAreaBottom, WithGridAreaLeft or WithGridAreaRight.

Not all values will be available for every plot type. Example usage:

>>> from tecplot.constant import AxisAlignment
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.alignment = AxisAlignment.WithGridMin
Cartesian2DAxisLine.color

Color of the axis line.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.color = Color.Blue
Cartesian2DAxisLine.line_thickness

Width of the axis line to be drawn.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.line_thickness = 0.5
Cartesian2DAxisLine.offset

Axis line placement with respect to the grid border.

Type:float (percent of frame height)

This is the offset from the grid border-aligned position dictated by properties such as AxisLine2D.alignment. The example moves the axis line into the plot by 5% of the frame height:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.offset = -5
Cartesian2DAxisLine.opposing_axis_value

Axis line placement with respect to the opposing axis.

Type:float

The axis alignment must be set to AxisAlignment.WithOpposingAxisValue to make this property relevant:

>>> from tecplot.constant import AxisAlignment
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.alignment = AxisAlignment.WithOpposingAxisValue
>>> axis.line.opposing_axis_value = 0.5
Cartesian2DAxisLine.position

Axis line placement with respect to the viewport.

Type:float

The axis alignment must be set to AxisAlignment.WithViewport to make this property relevant:

>>> from tecplot.constant import AxisAlignment
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.alignment = AxisAlignment.WithViewport
>>> axis.line.position = 0.5
Cartesian2DAxisLine.show

Draw the primary axis line on the plot.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.show = False

AxisLine3D

class tecplot.plot.AxisLine3D(axis)[source]

X, Y or Z axis for 3D field plots.

This represents the line along which ticks and labels are drawn. The color affects the line itself and the associated tick marks but not labels or axis titles:

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Color

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D_Volume', 'tritorus.lpk')
dataset = tp.load_layout(infile)

frame = tp.active_frame()
plot = frame.plot()

plot.show_mesh = False
plot.axes.grid_area.fill_color = Color.Grey

for ax in [plot.axes.x_axis, plot.axes.y_axis, plot.axes.z_axis]:
    ax.show = True
    ax.grid_lines.show = False
    ax.line.color = Color.Cyan
    ax.line.line_thickness = 0.2
    ax.line.show_on_opposite_edge = True

plot.view.fit()

tp.export.save_png('axis_line_3d.png', 600)
../_images/axis_line_3d.png

Attributes

color Color of the axis line.
edge_assignment Edge to use when drawing the primary axis line.
line_thickness Width of the axis line to be drawn.
show Draw the primary axis line on the plot.
show_on_opposite_edge Draw axis line on opposite edge of axes box.
AxisLine3D.color

Color of the axis line.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.color = Color.Blue
AxisLine3D.edge_assignment

Edge to use when drawing the primary axis line.

Type:AxisLine3DAssignment or None

Possible values: AxisLine3DAssignment.Automatic (aliased to None), YMinZMin, YMaxZMin, YMinZMax, YMaxZMax.

Example usage:

>>> from tecplot.constant import AxisLine3DAssignment
>>> axis.line.edge_assignment = AxisLine3DAssignment.YMinZMin
AxisLine3D.line_thickness

Width of the axis line to be drawn.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.line_thickness = 0.5
AxisLine3D.show

Draw the primary axis line on the plot.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.show = False
AxisLine3D.show_on_opposite_edge

Draw axis line on opposite edge of axes box.

Type:boolean

Example usage:

>>> plot.axes.x_axis.line.show_on_opposite_edge = True

RadialAxisLine2D

class tecplot.plot.RadialAxisLine2D(axis)[source]

Radial axis line for polar plots.

import numpy as np
import tecplot as tp
from tecplot.constant import PlotType, Color

npoints = 300
r = np.linspace(0, 2000, npoints)
theta = np.linspace(0, 700, npoints)

frame = tp.active_frame()
dataset = frame.create_dataset('Data', ['R', 'Theta'])
zone = dataset.add_ordered_zone('Zone', (300,))
zone.variable('R')[:] = r
zone.variable('Theta')[:] = theta

plot = frame.plot(PlotType.PolarLine)
plot.activate()

plot.axes.r_axis.max = np.max(r)

plot.delete_linemaps()
lmap = plot.add_linemap('Linemap', zone, dataset.variable('R'),
                        dataset.variable('Theta'))
lmap.line.line_thickness = 0.8

raxis = plot.axes.r_axis
raxis.line.show_both_directions = True
raxis.line.show_perpendicular = True

plot.view.fit()

tp.export.save_png('axis_line_radial.png', 600)
../_images/axis_line_radial.png

Attributes

alignment Axis line placement.
color Color of the axis line.
line_thickness Width of the axis line to be drawn.
offset Axis line placement with respect to the grid border.
opposing_axis_value Axis line placement with respect to the opposing axis.
show Draw the primary axis line on the plot.
show_both_directions Mirror the radial axis 180 degrees from the primary line.
show_perpendicular Mirror the radial axis 90 degrees from the primary line.
RadialAxisLine2D.alignment

Axis line placement.

Type:AxisAlignment

Possible values: WithViewport, WithOpposingAxisValue, WithGridMin, WithGridMax, WithSpecificAngle, WithGridAreaTop, WithGridAreaBottom, WithGridAreaLeft or WithGridAreaRight.

Not all values will be available for every plot type. Example usage:

>>> from tecplot.constant import AxisAlignment
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.alignment = AxisAlignment.WithGridMin
RadialAxisLine2D.color

Color of the axis line.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.color = Color.Blue
RadialAxisLine2D.line_thickness

Width of the axis line to be drawn.

Type:float

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.line_thickness = 0.5
RadialAxisLine2D.offset

Axis line placement with respect to the grid border.

Type:float (percent of frame height)

This is the offset from the grid border-aligned position dictated by properties such as AxisLine2D.alignment. The example moves the axis line into the plot by 5% of the frame height:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.offset = -5
RadialAxisLine2D.opposing_axis_value

Axis line placement with respect to the opposing axis.

Type:float

The axis alignment must be set to AxisAlignment.WithOpposingAxisValue to make this property relevant:

>>> from tecplot.constant import AxisAlignment
>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.alignment = AxisAlignment.WithOpposingAxisValue
>>> axis.line.opposing_axis_value = 0.5
RadialAxisLine2D.show

Draw the primary axis line on the plot.

Type:boolean

Example usage:

>>> # get axis via "plot.axes.x_axis(0)" for line plots
>>> # or "plot.axes.x_axis" for field or sketch plots
>>> axis.line.show = False
RadialAxisLine2D.show_both_directions

Mirror the radial axis 180 degrees from the primary line.

Type:boolean

If RadialAxisLine2D.show_perpendicular is True, this will mirror that axis line as well resulting in four axis lines, 90 degrees apart. Example usage:

>>> r_axis.line.show_both_directions = True
RadialAxisLine2D.show_perpendicular

Mirror the radial axis 90 degrees from the primary line.

Type:boolean

Example usage:

>>> r_axis.line.show_perpendicular = True

Ticks and Labels

Ticks2D

class tecplot.plot.Ticks2D(axis)[source]

Tick marks (major and minor) along axes in 2D.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, AxisMode, AxisAlignment, TickDirection

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '2D', 'cstream.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian2D)

plot.show_contour = True
plot.contour(0).variable = dataset.variable('v3')
plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'

plot.axes.axis_mode = AxisMode.Independent
plot.axes.x_axis.line.show = False

yaxis = plot.axes.y_axis
yaxis.max = 0.15
yaxis.line.show = False
yaxis.line.alignment = AxisAlignment.WithOpposingAxisValue
yaxis.line.opposing_axis_value = 0
yaxis.tick_labels.transparent_background = True
yaxis.tick_labels.offset = -5

yticks = yaxis.ticks
yticks.direction = TickDirection.Centered

for ticks in [plot.axes.x_axis.ticks, yticks]:
    ticks.spacing = 0.05
    ticks.minor_num_ticks = 0
    ticks.length *= 3
    ticks.line_thickness *= 2

tp.export.save_png('ticks_2d.png', 600)
../_images/ticks_2d.png

Attributes

direction How to draw the ticks with respect the axis line.
length Size of the major tick lines to draw.
line_thickness Width of the major tick lines to be drawn.
minor_length Size of the minor tick lines to draw.
minor_line_thickness Width of the minor tick lines to be drawn.
minor_num_ticks Number of minor ticks between each major tick.
show Draw ticks along axis.
show_on_border_max Draw ticks along the upper border of the axes grid.
show_on_border_min Draw ticks along the lower border of the axes grid.
spacing Distance between major ticks.
spacing_anchor Value to place the first major tick mark.
Ticks2D.direction

How to draw the ticks with respect the axis line.

Type:TickDirection

Possible values: TickDirection.In, TickDirection.Out or TickDirection.Centered:

>>> from tecplot.constant import TickDirection
>>> axis.ticks.direction = TickDirection.Centered
Ticks2D.length

Size of the major tick lines to draw.

Type:float (percent of frame height)

Example usage:

>>> axis.ticks.length = 2
Ticks2D.line_thickness

Width of the major tick lines to be drawn.

Type:float

Example usage:

>>> axis.ticks.line_thickness = 0.4
Ticks2D.minor_length

Size of the minor tick lines to draw.

Type:float (percent of frame height)

Example usage:

>>> axis.ticks.minor_length = 1.2
Ticks2D.minor_line_thickness

Width of the minor tick lines to be drawn.

Type:float

Example usage:

>>> axis.ticks.minor_line_thickness = 0.1
Ticks2D.minor_num_ticks

Number of minor ticks between each major tick.

Type:int

Example usage:

>>> axis.ticks.minor_num_ticks = 3
Ticks2D.show

Draw ticks along axis.

Type:boolean

Example usage:

>>> axis.ticks.show = True
Ticks2D.show_on_border_max

Draw ticks along the upper border of the axes grid.

Type:boolean

Example usage:

>>> axis.ticks.show_on_border_max = True
Ticks2D.show_on_border_min

Draw ticks along the lower border of the axes grid.

Type:boolean

Example usage:

>>> axis.ticks.show_on_border_min = True
Ticks2D.spacing

Distance between major ticks.

Type:float (axis data units) or TickSpacing.Automatic

Example usage:

>>> axis.ticks.spacing = 0.2
Ticks2D.spacing_anchor

Value to place the first major tick mark.

Type:float

All ticks will placed around this anchor position:

>>> axis.ticks.spacing_anchor = 0.05

Ticks3D

class tecplot.plot.Ticks3D(axis)[source]

Tick marks (major and minor) along axes in 3D.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, TickDirection

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D', 'crank.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian3D)
plot.activate()

plot.show_contour = True
plot.contour(0).legend.show = False
plot.axes.grid_area.fill_color = None

for axis in plot.axes:
    axis.show = True
    axis.grid_lines.show = False

    axis.ticks.length *= 4
    axis.ticks.minor_length *= 4

plot.view.fit()

tp.export.save_png('ticks_3d.png', 600)
../_images/ticks_3d.png

Attributes

direction How to draw the ticks with respect the axis line.
length Size of the major tick lines to draw.
line_thickness Width of the major tick lines to be drawn.
minor_length Size of the minor tick lines to draw.
minor_line_thickness Width of the minor tick lines to be drawn.
minor_num_ticks Number of minor ticks between each major tick.
show Draw ticks along axis.
show_on_opposite_edge Draw ticks along the opposite border of the axes grid.
spacing Distance between major ticks.
spacing_anchor Value to place the first major tick mark.
Ticks3D.direction

How to draw the ticks with respect the axis line.

Type:TickDirection

Possible values: TickDirection.In, TickDirection.Out or TickDirection.Centered:

>>> from tecplot.constant import TickDirection
>>> axis.ticks.direction = TickDirection.Centered
Ticks3D.length

Size of the major tick lines to draw.

Type:float (percent of frame height)

Example usage:

>>> axis.ticks.length = 2
Ticks3D.line_thickness

Width of the major tick lines to be drawn.

Type:float

Example usage:

>>> axis.ticks.line_thickness = 0.4
Ticks3D.minor_length

Size of the minor tick lines to draw.

Type:float (percent of frame height)

Example usage:

>>> axis.ticks.minor_length = 1.2
Ticks3D.minor_line_thickness

Width of the minor tick lines to be drawn.

Type:float

Example usage:

>>> axis.ticks.minor_line_thickness = 0.1
Ticks3D.minor_num_ticks

Number of minor ticks between each major tick.

Type:int

Example usage:

>>> axis.ticks.minor_num_ticks = 3
Ticks3D.show

Draw ticks along axis.

Type:boolean

Example usage:

>>> axis.ticks.show = True
Ticks3D.show_on_opposite_edge

Draw ticks along the opposite border of the axes grid.

Type:boolean

Example usage:

>>> axis.ticks.show_on_opposite_edge = True
Ticks3D.spacing

Distance between major ticks.

Type:float (axis data units) or TickSpacing.Automatic

Example usage:

>>> axis.ticks.spacing = 0.2
Ticks3D.spacing_anchor

Value to place the first major tick mark.

Type:float

All ticks will placed around this anchor position:

>>> axis.ticks.spacing_anchor = 0.05

RadialTicks

class tecplot.plot.RadialTicks(axis)[source]

Tick marks (major and minor) along the radial axis.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, ThetaMode, Color, TickDirection

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

plot = tp.active_frame().plot(PlotType.PolarLine)
plot.activate()

plot.axes.theta_axis.mode = ThetaMode.Radians

raxis = plot.axes.r_axis
raxis.line.color = Color.Red
raxis.tick_labels.offset = -4

raxis.ticks.direction =TickDirection.Centered
raxis.ticks.line_thickness = 0.8
raxis.ticks.length = 4
raxis.ticks.minor_length = 4

tp.export.save_png('ticks_radial.png', 600)
../_images/ticks_radial.png

Attributes

direction How to draw the ticks with respect the axis line.
length Size of the major tick lines to draw.
line_thickness Width of the major tick lines to be drawn.
minor_length Size of the minor tick lines to draw.
minor_line_thickness Width of the minor tick lines to be drawn.
minor_num_ticks Number of minor ticks between each major tick.
show Draw ticks along axis.
show_on_all_radial_axes Draw ticks along all radial axis lines.
show_on_border_max Draw ticks along the upper border of the axes grid.
show_on_border_min Draw ticks along the lower border of the axes grid.
spacing Distance between major ticks.
spacing_anchor Value to place the first major tick mark.
RadialTicks.direction

How to draw the ticks with respect the axis line.

Type:TickDirection

Possible values: TickDirection.In, TickDirection.Out or TickDirection.Centered:

>>> from tecplot.constant import TickDirection
>>> axis.ticks.direction = TickDirection.Centered
RadialTicks.length

Size of the major tick lines to draw.

Type:float (percent of frame height)

Example usage:

>>> axis.ticks.length = 2
RadialTicks.line_thickness

Width of the major tick lines to be drawn.

Type:float

Example usage:

>>> axis.ticks.line_thickness = 0.4
RadialTicks.minor_length

Size of the minor tick lines to draw.

Type:float (percent of frame height)

Example usage:

>>> axis.ticks.minor_length = 1.2
RadialTicks.minor_line_thickness

Width of the minor tick lines to be drawn.

Type:float

Example usage:

>>> axis.ticks.minor_line_thickness = 0.1
RadialTicks.minor_num_ticks

Number of minor ticks between each major tick.

Type:int

Example usage:

>>> axis.ticks.minor_num_ticks = 3
RadialTicks.show

Draw ticks along axis.

Type:boolean

Example usage:

>>> axis.ticks.show = True
RadialTicks.show_on_all_radial_axes

Draw ticks along all radial axis lines.

Type:boolean

Example usage:

>>> plot.axes.r_axis.line.show_perpendicular = True
>>> plot.axes.r_axis.ticks.show_on_all_radial_axes = True
RadialTicks.show_on_border_max

Draw ticks along the upper border of the axes grid.

Type:boolean

Example usage:

>>> axis.ticks.show_on_border_max = True
RadialTicks.show_on_border_min

Draw ticks along the lower border of the axes grid.

Type:boolean

Example usage:

>>> axis.ticks.show_on_border_min = True
RadialTicks.spacing

Distance between major ticks.

Type:float (axis data units) or TickSpacing.Automatic

Example usage:

>>> axis.ticks.spacing = 0.2
RadialTicks.spacing_anchor

Value to place the first major tick mark.

Type:float

All ticks will placed around this anchor position:

>>> axis.ticks.spacing_anchor = 0.05

TickLabels2D

class tecplot.plot.TickLabels2D(axis)[source]

Tick labels along axes in 2D.

from datetime import datetime
import tecplot as tp
from tecplot.constant import (PlotType, AxisMode, AxisAlignment, NumberFormat,
                              Color)

# tecplot dates are in days after Midnight, Dec 30, 1899
origin = datetime(1899, 12, 30)
start = (datetime(1955, 11,  5) - origin).days
stop  = (datetime(1985, 10, 26) - origin).days

tp.new_layout()
plot = tp.active_frame().plot(tp.constant.PlotType.Sketch)
plot.activate()

plot.axes.viewport.left = 15
plot.axes.viewport.right = 95

xaxis = plot.axes.x_axis
xaxis.show = True
xaxis.min, xaxis.max = start, stop
xaxis.line.alignment = AxisAlignment.WithViewport
xaxis.line.position = 50
xaxis.ticks.spacing = (stop - start) // 4
xaxis.ticks.spacing_anchor = start

xaxis.tick_labels.format.format_type = NumberFormat.TimeDate
xaxis.tick_labels.format.datetime_format = 'mmm d, yyyy'
xaxis.tick_labels.color = Color.Blue
xaxis.tick_labels.angle = 45

tp.export.save_png('tick_labels_2d.png', 600)
../_images/tick_labels_2d.png

Attributes

angle Angle at which to render the label text.
color Color of the tick labels.
font Text style control including typeface and size.
format Label format and style control.
offset Relative offset of the tick labels.
show Draw labels for the major tick marks.
show_at_axis_intersection Include the labels at the intersection of other axes.
show_on_border_max Draw labels along the upper grid area border.
show_on_border_min Draw labels along the lower grid area border.
step Step for labels placed on major ticks.
transparent_background Make the text box around each label transparent.
TickLabels2D.angle

Angle at which to render the label text.

Type:float (degrees) or LabelAlignment

Possible values: LabelAlignment.AlongAxis or LabelAlignment.PerpendicularToAxis.

Example usage:

>>> from tecplot.constant import LabelAlignment
>>> axis.tick_labels.angle = LabelAlignment.AlongAxis
TickLabels2D.color

Color of the tick labels.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> axis.tick_labels.color = Color.Blue
TickLabels2D.font

Text style control including typeface and size.

Type:Font

Example usage:

>>> axis.tick_labels.font.typeface = 'Times'
TickLabels2D.format

Label format and style control.

Type:LabelFormat

Example usage:

>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
TickLabels2D.offset

Relative offset of the tick labels.

Type:float

Positive values will be outside the grid area, negative values are inside the grid area:

>>> axis.tick_labels.offset = 5
TickLabels2D.show

Draw labels for the major tick marks.

Type:boolean

Example usage:

>>> axis.tick_labels.show = True
TickLabels2D.show_at_axis_intersection

Include the labels at the intersection of other axes.

Type:bool

Example usage:

>>> axis.tick_labels.show_at_axis_intersection = True
TickLabels2D.show_on_border_max

Draw labels along the upper grid area border.

Type:bool

Example usage:

>>> axis.tick_labels.show_on_border_max = True
TickLabels2D.show_on_border_min

Draw labels along the lower grid area border.

Type:bool

Example usage:

>>> axis.tick_labels.show_on_border_min = True
TickLabels2D.step

Step for labels placed on major ticks.

Type:int

A value of 1 will place a label on every major tick mark:

>>> axis.tick_labels.step = 1
TickLabels2D.transparent_background

Make the text box around each label transparent.

Type:bool

Example usage:

>>> axis.tick_labels.transparent_background = True

TickLabels3D

class tecplot.plot.TickLabels3D(axis)[source]

Tick labels along axes in 3D.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Color

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D_Volume', 'isosurfaces.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian3D)
plot.activate()

plot.show_contour = True

for ax in [plot.axes.x_axis, plot.axes.y_axis]:
    xaxis = plot.axes.x_axis
    ax.show = True
    ax.title.show = False
    ax.line.show_on_opposite_edge = True
    ax.ticks.show_on_opposite_edge = True

    ax.tick_labels.color = Color.Blue
    ax.tick_labels.show_on_opposite_edge = True
    ax.tick_labels.font.typeface = 'Times'
    ax.tick_labels.font.size = 8
    ax.tick_labels.font.italic = True

plot.view.fit()

tp.export.save_png('tick_labels_3d.png', 600)
../_images/tick_labels_3d.png

Attributes

angle Angle at which to render the label text.
color Color of the tick labels.
font Text style control including typeface and size.
format Label format and style control.
offset Relative offset of the tick labels.
show Draw labels for the major tick marks.
show_on_opposite_edge Draw labels on the opposite edge of the grid.
step Step for labels placed on major ticks.
TickLabels3D.angle

Angle at which to render the label text.

Type:float (degrees) or LabelAlignment

Possible values: LabelAlignment.AlongAxis or LabelAlignment.PerpendicularToAxis.

Example usage:

>>> from tecplot.constant import LabelAlignment
>>> axis.tick_labels.angle = LabelAlignment.AlongAxis
TickLabels3D.color

Color of the tick labels.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> axis.tick_labels.color = Color.Blue
TickLabels3D.font

Text style control including typeface and size.

Type:Font

Example usage:

>>> axis.tick_labels.font.typeface = 'Times'
TickLabels3D.format

Label format and style control.

Type:LabelFormat

Example usage:

>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
TickLabels3D.offset

Relative offset of the tick labels.

Type:float

Positive values will be outside the grid area, negative values are inside the grid area:

>>> axis.tick_labels.offset = 5
TickLabels3D.show

Draw labels for the major tick marks.

Type:boolean

Example usage:

>>> axis.tick_labels.show = True
TickLabels3D.show_on_opposite_edge

Draw labels on the opposite edge of the grid.

Type:boolean

Example usage:

>>> axis.tick_labels.show_on_opposite_edge = True
TickLabels3D.step

Step for labels placed on major ticks.

Type:int

A value of 1 will place a label on every major tick mark:

>>> axis.tick_labels.step = 1

RadialTickLabels

class tecplot.plot.RadialTickLabels(axis)[source]

Tick mark labels along the radial axis.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, ThetaMode, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

plot = tp.active_frame().plot(PlotType.PolarLine)
plot.activate()

plot.axes.theta_axis.mode = ThetaMode.Radians

raxis = plot.axes.r_axis
raxis.line.color = Color.Red
raxis.tick_labels.offset = -4
raxis.tick_labels.color = Color.Red
raxis.tick_labels.font.bold = True

tp.export.save_png('tick_labels_radial.png', 600)
../_images/tick_labels_radial.png

Attributes

angle Angle at which to render the label text.
color Color of the tick labels.
font Text style control including typeface and size.
format Label format and style control.
offset Relative offset of the tick labels.
show Draw labels for the major tick marks.
show_at_axis_intersection Include the labels at the intersection of other axes.
show_on_all_radial_axes Draw labels along all radial axis lines.
show_on_border_max Draw labels along the upper grid area border.
show_on_border_min Draw labels along the lower grid area border.
step Step for labels placed on major ticks.
transparent_background Make the text box around each label transparent.
RadialTickLabels.angle

Angle at which to render the label text.

Type:float (degrees) or LabelAlignment

Possible values: LabelAlignment.AlongAxis or LabelAlignment.PerpendicularToAxis.

Example usage:

>>> from tecplot.constant import LabelAlignment
>>> axis.tick_labels.angle = LabelAlignment.AlongAxis
RadialTickLabels.color

Color of the tick labels.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> axis.tick_labels.color = Color.Blue
RadialTickLabels.font

Text style control including typeface and size.

Type:Font

Example usage:

>>> axis.tick_labels.font.typeface = 'Times'
RadialTickLabels.format

Label format and style control.

Type:LabelFormat

Example usage:

>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
RadialTickLabels.offset

Relative offset of the tick labels.

Type:float

Positive values will be outside the grid area, negative values are inside the grid area:

>>> axis.tick_labels.offset = 5
RadialTickLabels.show

Draw labels for the major tick marks.

Type:boolean

Example usage:

>>> axis.tick_labels.show = True
RadialTickLabels.show_at_axis_intersection

Include the labels at the intersection of other axes.

Type:bool

Example usage:

>>> axis.tick_labels.show_at_axis_intersection = True
RadialTickLabels.show_on_all_radial_axes

Draw labels along all radial axis lines.

Type:boolean

Example usage:

>>> plot.axes.r_axis.line.show_perpendicular = True
>>> plot.axes.r_axis.tick_labels.show_on_all_radial_axes = True
RadialTickLabels.show_on_border_max

Draw labels along the upper grid area border.

Type:bool

Example usage:

>>> axis.tick_labels.show_on_border_max = True
RadialTickLabels.show_on_border_min

Draw labels along the lower grid area border.

Type:bool

Example usage:

>>> axis.tick_labels.show_on_border_min = True
RadialTickLabels.step

Step for labels placed on major ticks.

Type:int

A value of 1 will place a label on every major tick mark:

>>> axis.tick_labels.step = 1
RadialTickLabels.transparent_background

Make the text box around each label transparent.

Type:bool

Example usage:

>>> axis.tick_labels.transparent_background = True

LabelFormat

class tecplot.plot.LabelFormat(tick_labels)[source]

Tick label string formatting.

from datetime import datetime
import tecplot as tp
from tecplot.constant import PlotType, AxisMode, AxisAlignment, NumberFormat

tp.new_layout()
plot = tp.active_frame().plot(tp.constant.PlotType.Sketch)
plot.activate()

# setup the plot area margins
plot.axes.viewport.left = 10
plot.axes.viewport.right = 90

# show the x-axis, set the title, and alignment with the viewport
xaxis = plot.axes.x_axis
xaxis.show = True
xaxis.title.text = 'Negative numbers in parentheses'
xaxis.title.offset = 20
xaxis.line.alignment = AxisAlignment.WithViewport
xaxis.line.position = 50

# set limits, tick placement and tick label properties
xaxis.min, xaxis.max = -5.123e-5, 5.234e-5
xaxis.ticks.spacing = (xaxis.max - xaxis.min) / 6
xaxis.ticks.spacing_anchor = 0
xaxis.tick_labels.angle = 45
xaxis.tick_labels.offset = 3

# format the tick labels in superscript form. example: 1.234x10^5
# format negative numbers to use parentheses instead of a negative sign
xformat = xaxis.tick_labels.format
xformat.format_type = NumberFormat.SuperScript
xformat.precision = 3
xformat.show_negative_sign = False
xformat.negative_prefix = '('
xformat.negative_suffix = ')'

tp.export.save_png('label_format.png', 600)
../_images/label_format.png

Attributes

custom_labels_index Index of the custom label to use.
datetime_format The date/time format to be used.
format_type Type of number formatting to use.
negative_prefix Prefix string to use for negative valued tick labels.
negative_suffix Suffix string to use for negative valued tick labels.
num_custom_labels Number of custom label sets available to use.
positive_prefix Prefix string to use for positive valued tick labels.
positive_suffix Suffix string to use for positive valued tick labels.
precision Number digits after decimal for fixed floating point format.
remove_leading_zeros Strip leading zeros in the formatted number.
show_decimals_on_whole_numbers Include trailing decimal character with whole numbers.
show_negative_sign Include negative sign for negative values.
zero_prefix Prefix string to use for zero valued tick labels.
zero_suffix Suffix string to use for zero valued tick labels.

Methods

add_custom_labels(*labels) Append a list of custom labels as a new set.
custom_labels(index) List of labels for custom labels for set specified by index.
LabelFormat.add_custom_labels(*labels)[source]

Append a list of custom labels as a new set.

Example usage:

>>> labels = ['apples', 'bananas', 'carrots']
>>> axis.tick_labels.format.add_custom_labels(*labels)
>>> print(axis.tick_labels.format.custom_labels(-1))
['apples', 'bananas', 'carrots']
LabelFormat.custom_labels(index)[source]

List of labels for custom labels for set specified by index.

Example usage:

>>> axis.tick_labels.format.custom_labels(0)
['apples', 'bananas', 'carrots']
LabelFormat.custom_labels_index

Index of the custom label to use.

Type:Index (zero-based)

Example usage:

>>> axis.tick_labels.format.custom_labels_index = 0
LabelFormat.datetime_format

The date/time format to be used.

Type:string

Example usage:

>>> from tecplot.constant import NumberFormat
>>> axis.tick_labels.format.format_type = NumberFormat.TimeDate
>>> axis.tick_labels.format.datetime_format = 'mmm d, yyyy'

The format can be any combination of the following codes. Placing a backslash in front of a y, m, d, or s in the Time/Date formula will keep it from being processed as part of the formula. All characters not part of the Time/Date formula will appear as entered. For example, “\year yyyy” will appear as “year 2008”, as the backslash keeps the first y from being processed as part of the formula. If you use “m” immediately after the “h” or “hh” code or immediately before the “ss” code, the minutes instead of the month will be displayed.

Years:
yy 00-99
yyyy 1800-9999
Months:
m 1-12
mm 01-12
mmm Jan-Dec
mmmm January-December
mmmmm first letter of the month
Days:
[d] elapsed days
d 1-31
dd 01-31
ddd Sun-Sat
dddd Sunday-Saturday
ddddd S,M,T,W,T,F,S
Hours:
[h] elapsed hours
h 0-23 or 1-12
hh 00-23 or 1-12
AM/PM AM or PM
A/P AM or PM as “A” or “P”
Minutes:
[m] elapsed minutes
m 0-59
mm 00-59
Seconds:  
s 0-59
ss 00-59
.0 Tenths
.00 Hundredths
.000 Thousandths

To display the time and date on your plot as a “Sat-Jan-05-2008”, enter the following code:

"ddd-mmm-dd-yyyy"

To display the time and date on your plot as a “1-3-08”, enter the following code:

"m-d-yy"

To display the time and date on your plot as a “9:30:05 AM”, enter the following code:

"h:mm:ss AM"

To display an elapsed time, such as “3:10:15”, enter the following code:

"[d]:hh:mm"
LabelFormat.format_type

Type of number formatting to use.

Type:NumberFormat

Possible values: Integer, FixedFloat, Exponential, BestFloat, SuperScript, CustomLabel, LogSuperScript, RangeBestFloat, DynamicLabel, TimeDate.

Example usage:

>>> from tecplot.constant import NumberFormat
>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
LabelFormat.negative_prefix

Prefix string to use for negative valued tick labels.

Type:string

This example shows how to use parentheses instead of a negative sign:

>>> axis.tick_labels.format.show_negative_sign = False
>>> axis.tick_labels.format.negative_prefix = '('
>>> axis.tick_labels.format.negative_suffix = ')'
LabelFormat.negative_suffix

Suffix string to use for negative valued tick labels.

Type:string

This example shows how to use parentheses instead of a negative sign:

>>> axis.tick_labels.format.show_negative_sign = False
>>> axis.tick_labels.format.negative_prefix = '('
>>> axis.tick_labels.format.negative_suffix = ')'
LabelFormat.num_custom_labels

Number of custom label sets available to use.

Type:int

Example usage:

>>> print(axis.tick_labels.format.num_custom_labels)
1
LabelFormat.positive_prefix

Prefix string to use for positive valued tick labels.

Type:string

Example usage:

>>> axis.tick_labels.format.positive_prefix = 'increase: '
LabelFormat.positive_suffix

Suffix string to use for positive valued tick labels.

Type:string

Example usage:

>>> axis.tick_labels.format.positive_suffix = ' (m)'
LabelFormat.precision

Number digits after decimal for fixed floating point format.

Type:integer

Example usage:

>>> from tecplot.constant import NumberFormat
>>> axis.tick_labels.format.format_type = NumberFormat.FixedFloat
>>> axis.tick_labels.format.precision = 3
LabelFormat.remove_leading_zeros

Strip leading zeros in the formatted number.

Type:boolean

Example usage:

>>> axis.tick_labels.format.remove_leading_zeros = True
LabelFormat.show_decimals_on_whole_numbers

Include trailing decimal character with whole numbers.

Type:boolean

Example usage:

>>> axis.tick_labels.format.show_decimals_on_whole_numbers = True
LabelFormat.show_negative_sign

Include negative sign for negative values.

Type:boolean

Example usage:

>>> axis.tick_labels.format.show_negative_sign = True
LabelFormat.zero_prefix

Prefix string to use for zero valued tick labels.

Type:string

Example usage:

>>> axis.tick_labels.format.zero_prefix = 'origin: '
LabelFormat.zero_suffix

Suffix string to use for zero valued tick labels.

Type:string

Example usage:

>>> axis.tick_labels.format.zero_suffix = ' (origin)'

Axis Title

Axis2DTitle

class tecplot.plot.Axis2DTitle(axis)[source]

Sketch plot axis label string, font and style control.

import tecplot as tp
from tecplot.constant import PlotType, Color

plot = tp.active_frame().plot(PlotType.Sketch)

viewport = plot.axes.viewport
viewport.left = 10
viewport.right = 90
viewport.bottom = 10

xaxis = plot.axes.x_axis
xaxis.show = True
xaxis.title.text = 'distance (m)'
xaxis.title.color = Color.DarkTurquoise
xaxis.title.offset = -7

tp.export.save_png('axis_title_sketch.png', 600)
../_images/axis_title_sketch.png

Attributes

color Text color of axis title.
font Typeface and size of the text.
offset Transverse offset of the title from the axis.
position Percent along axis line to place title.
show Place title along the axis.
show_on_border_max Draw title along the upper grid area border.
show_on_border_min Draw title along the lower grid area border.
text The text of the title for this axis.
Axis2DTitle.color

Text color of axis title.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> axis.title.color = Color.Blue
Axis2DTitle.font

Typeface and size of the text.

Type:Font

Example usage:

>>> axis.title.font.size = 5
Axis2DTitle.offset

Transverse offset of the title from the axis.

Type:float in percent of frame height.

Positive values are outside the axes, negative numbers are inside the axes. Example usage:

>>> axis.title.offset = 5
Axis2DTitle.position

Percent along axis line to place title.

Type:float

Example usage:

>>> axis.title.position = 50
Axis2DTitle.show

Place title along the axis.

Type:boolean

Example usage:

>>> axis.title.show = False
Axis2DTitle.show_on_border_max

Draw title along the upper grid area border.

Type:bool

Example usage:

>>> axis.title.show_on_border_max = True
Axis2DTitle.show_on_border_min

Draw title along the lower grid area border.

Type:bool

Example usage:

>>> axis.title.show_on_border_min = True
Axis2DTitle.text

The text of the title for this axis.

Type:string

Example usage:

>>> axis.title.text = 'distance (m)'

DataAxis2DTitle

class tecplot.plot.DataAxis2DTitle(axis)[source]

Axis label string, font and style control for 2D data plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, SurfacesToPlot, Color

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D', 'jet_surface.plt')
dataset = tp.data.load_tecplot(infile)

plot = tp.active_frame().plot(PlotType.Cartesian2D)
plot.activate()

plot.show_contour = True
plot.contour(0).variable = dataset.variable('S')
plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'
plot.contour(0).legend.show = False

plot.fieldmap(0).surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces

xaxis = plot.axes.x_axis
xaxis.title.text = 'Longitudinal (m)'
xaxis.title.color = Color.Blue

# place the x-axis title at the x-coordinate 10.0
xaxis.title.position = 100 * (10.0 - xaxis.min) / (xaxis.max - xaxis.min)

yaxis = plot.axes.y_axis
yaxis.title.text = 'Transverse (m)'
yaxis.title.color = Color.Blue

# place the y-axis title at the y-coordinate 0.0
yaxis.title.position = 100 * (0.0 - yaxis.min) / (yaxis.max - yaxis.min)

tp.export.save_png('axis_title_2d.png', 600)
../_images/axis_title_2d.png

Attributes

color Text color of axis title.
font Typeface and size of the text.
offset Transverse offset of the title from the axis.
position Percent along axis line to place title.
show Place title along the axis.
show_on_border_max Draw title along the upper grid area border.
show_on_border_min Draw title along the lower grid area border.
text The text of the title for this axis.
DataAxis2DTitle.color

Text color of axis title.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> axis.title.color = Color.Blue
DataAxis2DTitle.font

Typeface and size of the text.

Type:Font

Example usage:

>>> axis.title.font.size = 5
DataAxis2DTitle.offset

Transverse offset of the title from the axis.

Type:float in percent of frame height.

Positive values are outside the axes, negative numbers are inside the axes. Example usage:

>>> axis.title.offset = 5
DataAxis2DTitle.position

Percent along axis line to place title.

Type:float

Example usage:

>>> axis.title.position = 50
DataAxis2DTitle.show

Place title along the axis.

Type:boolean

Example usage:

>>> axis.title.show = False
DataAxis2DTitle.show_on_border_max

Draw title along the upper grid area border.

Type:bool

Example usage:

>>> axis.title.show_on_border_max = True
DataAxis2DTitle.show_on_border_min

Draw title along the lower grid area border.

Type:bool

Example usage:

>>> axis.title.show_on_border_min = True
DataAxis2DTitle.text

The text of the title for this axis.

Type:string, AxisTitleMode.UseVarName or None

Setting this to None disables the axis title. Setting it to AxisTitleMode.UseVarName means the title will be pulled from the variable name in the dataset:

>>> from tecplot.constant import AxisTitleMode
>>> axis.title.text = AxisTitleMode.UseVarName

DataAxis3DTitle

class tecplot.plot.DataAxis3DTitle(axis)[source]

Axis label string, font and style control for 3D plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, SurfacesToPlot, Color

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D', 'jet_surface.plt')
dataset = tp.data.load_tecplot(infile)

plot = tp.active_frame().plot(PlotType.Cartesian3D)
plot.activate()

plot.show_contour = True
plot.contour(0).variable = dataset.variable('S')
plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'
plot.contour(0).legend.show = False

plot.fieldmap(0).surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces

xaxis = plot.axes.x_axis
xaxis.show = True
xaxis.title.text = 'Longitudinal (m)'
xaxis.title.color = Color.BluePurple
xaxis.title.position = 10

yaxis = plot.axes.y_axis
yaxis.show = True
yaxis.title.text = 'Transverse (m)'
yaxis.title.color = Color.BluePurple
yaxis.title.position = 90

zaxis = plot.axes.z_axis
zaxis.show = True
zaxis.title.text = 'Height (m)'
zaxis.title.color = Color.BluePurple
zaxis.title.offset = 13

plot.view.fit()

tp.export.save_png('axis_title_3d.png', 600)
../_images/axis_title_3d.png

Attributes

color Text color of axis title.
font Typeface and size of the text.
offset Transverse offset of the title from the axis.
position Percent along axis line to place title.
show Place title along the axis.
show_on_opposite_edge Draw the title on the opposite edge of the grid.
text The text of the title for this axis.
DataAxis3DTitle.color

Text color of axis title.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> axis.title.color = Color.Blue
DataAxis3DTitle.font

Typeface and size of the text.

Type:Font

Example usage:

>>> axis.title.font.size = 5
DataAxis3DTitle.offset

Transverse offset of the title from the axis.

Type:float in percent of frame height.

Positive values are outside the axes, negative numbers are inside the axes. Example usage:

>>> axis.title.offset = 5
DataAxis3DTitle.position

Percent along axis line to place title.

Type:float

Example usage:

>>> axis.title.position = 50
DataAxis3DTitle.show

Place title along the axis.

Type:boolean

Example usage:

>>> axis.title.show = False
DataAxis3DTitle.show_on_opposite_edge

Draw the title on the opposite edge of the grid.

Type:boolean

Example usage:

>>> axis.title.show_on_opposite_edge = True
DataAxis3DTitle.text

The text of the title for this axis.

Type:string, AxisTitleMode.UseVarName or None

Setting this to None disables the axis title. Setting it to AxisTitleMode.UseVarName means the title will be pulled from the variable name in the dataset:

>>> from tecplot.constant import AxisTitleMode
>>> axis.title.text = AxisTitleMode.UseVarName

RadialAxisTitle

class tecplot.plot.RadialAxisTitle(axis)[source]

Radial axis label string, font and style control for polar plots.

import numpy as np
import tecplot as tp
from tecplot.constant import PlotType, Color

npoints = 300
r = np.linspace(0, 2000, npoints)
theta = np.linspace(0, 1000, npoints)

frame = tp.active_frame()
dataset = frame.create_dataset('Data', ['R', 'Theta'])
zone = dataset.add_ordered_zone('Zone', (300,))
zone.variable('R')[:] = r
zone.variable('Theta')[:] = theta

plot = frame.plot(PlotType.PolarLine)
plot.activate()

plot.axes.r_axis.max = np.max(r)

plot.delete_linemaps()
lmap = plot.add_linemap('Linemap', zone, dataset.variable('R'),
                        dataset.variable('Theta'))
lmap.line.line_thickness = 0.8

raxis = plot.axes.r_axis
raxis.line.show_both_directions = True
raxis.line.show_perpendicular = True

raxis.title.text = 'Radial Position (cm)'
raxis.title.show_on_all_radial_axes = True
raxis.title.color = Color.Blue
raxis.title.position = 80

plot.view.fit()

tp.export.save_png('axis_title_radial.png', 600)
../_images/axis_title_radial.png

Attributes

color Text color of axis title.
font Typeface and size of the text.
offset Transverse offset of the title from the axis.
position Percent along axis line to place title.
show Place title along the axis.
show_on_all_radial_axes Draw title along all radial axis lines.
show_on_border_max Draw title along the upper grid area border.
show_on_border_min Draw title along the lower grid area border.
text The text of the title for this axis.
RadialAxisTitle.color

Text color of axis title.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> axis.title.color = Color.Blue
RadialAxisTitle.font

Typeface and size of the text.

Type:Font

Example usage:

>>> axis.title.font.size = 5
RadialAxisTitle.offset

Transverse offset of the title from the axis.

Type:float in percent of frame height.

Positive values are outside the axes, negative numbers are inside the axes. Example usage:

>>> axis.title.offset = 5
RadialAxisTitle.position

Percent along axis line to place title.

Type:float

Example usage:

>>> axis.title.position = 50
RadialAxisTitle.show

Place title along the axis.

Type:boolean

Example usage:

>>> axis.title.show = False
RadialAxisTitle.show_on_all_radial_axes

Draw title along all radial axis lines.

Type:boolean

Example usage:

>>> plot.axes.r_axis.line.show_perpendicular = True
>>> plot.axes.r_axis.title.show_on_all_radial_axes = True
RadialAxisTitle.show_on_border_max

Draw title along the upper grid area border.

Type:bool

Example usage:

>>> axis.title.show_on_border_max = True
RadialAxisTitle.show_on_border_min

Draw title along the lower grid area border.

Type:bool

Example usage:

>>> axis.title.show_on_border_min = True
RadialAxisTitle.text

The text of the title for this axis.

Type:string, AxisTitleMode.UseVarName or None

Setting this to None disables the axis title. Setting it to AxisTitleMode.UseVarName means the title will be pulled from the variable name in the dataset:

>>> from tecplot.constant import AxisTitleMode
>>> axis.title.text = AxisTitleMode.UseVarName

Font

class tecplot.plot.Font(parent)[source]

Style of text objects such as titles and labels.

This class controls the typeface and size of various text objects found in plots and axes:

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Units

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, 'OneraM6wing', 'OneraM6_SU2_RANS.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian2D)
plot.activate()

plot.show_contour = True

xaxis = plot.axes.x_axis
xaxis.title.text = 'Longitudinal (m)'
xaxis.min, xaxis.max = 0, 1.2

yaxis = plot.axes.y_axis
yaxis.title.text = 'Transverse (m)'
yaxis.min, yaxis.max = 0, 1.3

for ax in [xaxis, yaxis]:
    ax.title.font.typeface = 'Times'
    ax.title.font.bold = False
    ax.title.font.italic = True
    ax.title.font.size_units = Units.Frame
    ax.title.font.size = 7

tp.export.save_png('font.png', 600)
../_images/font.png

Attributes

bold Use the bold version of the current typeface.
italic Use the italic version of the current typeface.
size Height of the font.
size_units Units used by the size attribute.
typeface Specific font (or typeface) to use for text.
Font.bold

Use the bold version of the current typeface.

Type:boolean

Example:

>>> axis.title.font.bold = True
Font.italic

Use the italic version of the current typeface.

Type:boolean

Example:

>>> axis.title.font.italic = True
Font.size

Height of the font.

Type:float in units of Font.size_units

Example usage:

>>> axis.title.font.size = 10
Font.size_units

Units used by the size attribute.

Type:Units

Possible values: Units.Point, Units.Frame (percentage of frame height). This example sets the axis title to 10% of the frame height:

>>> from tecplot.constant import Units
>>> axis.title.font.size_units = Units.Frame
>>> axis.title.font.size = 10
Font.typeface

Specific font (or typeface) to use for text.

Type:string

This can be any font installed on the current system. If the font is not found, Times or Helvetica will be used when rendering the text. Example usage:

>>> axis.title.font.typeface = 'Times'

Grid Area

GridArea

class tecplot.plot.GridArea(axes)[source]

Grid area for polar 2D plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, ThetaMode, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

plot = tp.active_frame().plot(PlotType.PolarLine)
plot.activate()

plot.axes.theta_axis.mode = ThetaMode.Radians
plot.axes.grid_area.fill_color = Color.Creme

grid_area = plot.axes.grid_area
grid_area.fill_color = Color.SkyBlue
grid_area.show_border = True

tp.export.save_png('grid_area_polar.png', 600)
../_images/grid_area_polar.png

Attributes

fill_color Axes area background color.
show_border Draw border around axes area.
GridArea.fill_color

Axes area background color.

Type:Color or None

Example usage:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.fill_color = Color.LightGreen
GridArea.show_border

Draw border around axes area.

Type:boolean

Example usage:

>>> plot.axes.grid_area.show_border = True

Cartesian2DGridArea

class tecplot.plot.Cartesian2DGridArea(axes)[source]

Grid area for cartesian 2D plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Color

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, 'XY', 'y_axis2.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.XYLine)

plot.linemap(0).line.color = Color.DarkBlue
plot.linemap(0).line.line_thickness = 1.0

grid_area = plot.axes.grid_area
grid_area.fill_color = Color.SkyBlue
grid_area.show_border = True

tp.export.save_png('grid_area_2d.png', 600)
../_images/grid_area_2d.png

Attributes

border_color Border line color.
border_thickness Width of the border lines to be drawn.
fill_color Axes area background color.
show_border Draw border around axes area.
Cartesian2DGridArea.border_color

Border line color.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.show_border = True
>>> plot.axes.grid_area.border_color = Color.LightGreen
Cartesian2DGridArea.border_thickness

Width of the border lines to be drawn.

Type:float

Example usage:

>>> plot.axes.grid_area.border_thickness = 0.5
Cartesian2DGridArea.fill_color

Axes area background color.

Type:Color or None

Example usage:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.fill_color = Color.LightGreen
Cartesian2DGridArea.show_border

Draw border around axes area.

Type:boolean

Example usage:

>>> plot.axes.grid_area.show_border = True

Cartesian3DGridArea

class tecplot.plot.Cartesian3DGridArea(axes)[source]

Grid area for 3D field plots.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, SurfacesToPlot, Color

examples_dir = tp.session.tecplot_examples_directory()
infile = path.join(examples_dir, '3D', 'Arrow.plt')
dataset = tp.data.load_tecplot(infile)

frame = tp.active_frame()
plot = frame.plot(PlotType.Cartesian3D)
plot.show_contour = True
plot.contour(0).variable = dataset.variable('P')
plot.contour(0).legend.show = False

for fmap in plot.fieldmaps:
    fmap.contour.show = True
    fmap.surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces

for axis in plot.axes:
    axis.show = True

grid_area = plot.axes.grid_area
grid_area.fill_color = Color.SkyBlue
grid_area.show_border = True
grid_area.lighting_effect = True

plot.view.fit()

tp.export.save_png('grid_area_3d.png', 600)
../_images/grid_area_3d.png

Attributes

fill_color Axes area background color.
lighting_effect Enable lighting effect shading on grid area
show_border Draw border around axes area.
Cartesian3DGridArea.fill_color

Axes area background color.

Type:Color or None

Example usage:

>>> from tecplot.constant import Color
>>> plot.axes.grid_area.fill_color = Color.LightGreen
Cartesian3DGridArea.lighting_effect

Enable lighting effect shading on grid area

Type:boolean

Example usage:

>>> plot.axes.grid_area.lighting_effect = True
Cartesian3DGridArea.show_border

Draw border around axes area.

Type:boolean

Example usage:

>>> plot.axes.grid_area.show_border = True

PreciseGrid

class tecplot.plot.PreciseGrid(axes)[source]

Grid of precise dots aligned with all tick marks.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, LinePattern, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, '3D', 'RainierElevation.plt')
dataset = tp.data.load_tecplot(datafile)

plot = tp.active_frame().plot(PlotType.Cartesian2D)
plot.activate()

plot.show_contour = True
plot.contour(0).colormap_name = 'Elevation - Above Ground Level'

xaxis = plot.axes.x_axis
plot.axes.preserve_scale = True
xaxis.max = xaxis.variable.zone(0).max()

grid = plot.axes.precise_grid
grid.show = True
grid.size = 0.05

tp.export.save_png('precise_grid.png', 600)
../_images/precise_grid.png

Attributes

color Color of the dots for precise grid.
show Draw precise grid dots in axes area.
size Size of the dots for precise grid.
PreciseGrid.color

Color of the dots for precise grid.

Type:Color

Example usage:

>>> plot.axes.precise_grid.color = Color.DarkBlue
PreciseGrid.show

Draw precise grid dots in axes area.

Type:boolean

Example usage:

>>> plot.axes.precise_grid.show = True
PreciseGrid.size

Size of the dots for precise grid.

Type:float (cm)

Example usage:

>>> plot.axes.precise_grid.size = 0.2

GridLines

class tecplot.plot.GridLines(axis)[source]

Major grid lines following the primary tick mark locations.

The lines drawn are determined by the placement of major tick marks along the axis. Example usage:

from os import path
import tecplot as tp
from tecplot.constant import LinePattern, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

for axis in tp.active_frame().plot().axes:
    grid_lines = axis.grid_lines
    grid_lines.show = True
    grid_lines.line_pattern = LinePattern.LongDash
    grid_lines.color = Color.Green

tp.export.save_png('grid_lines.png', 600)
../_images/grid_lines.png

Attributes

color Color of the grid lines to be drawn.
draw_last Draw grid behind all other plot elements.
line_pattern Pattern style of the grid lines to be drawn.
line_thickness Width of the grid lines to be drawn.
pattern_length Segment length of the repeated line pattern.
show Draw grid lines as tick locations.
GridLines.color

Color of the grid lines to be drawn.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> grid_lines.color = Color.Blue
GridLines.draw_last

Draw grid behind all other plot elements.

Type:boolean

Example usage:

>>> grid_lines.draw_last = True
GridLines.line_pattern

Pattern style of the grid lines to be drawn.

Type:LinePattern

Possible values: Solid, Dashed, DashDot, Dotted, LongDash, DashDotDot.

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
GridLines.line_thickness

Width of the grid lines to be drawn.

Type:float

Example usage:

>>> grid_lines.line_thickness = 0.5
GridLines.pattern_length

Segment length of the repeated line pattern.

Type:float

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
>>> grid_lines.pattern_length = 3.5
GridLines.show

Draw grid lines as tick locations.

Type:boolean

Example usage:

>>> grid_lines.show = True

MinorGridLines

class tecplot.plot.MinorGridLines(axis)[source]

Minor grid lines following the secondary tick mark locations.

The lines drawn are determined by the placement of minor tick marks along the axis. Example usage:

from os import path
import tecplot as tp
from tecplot.constant import LinePattern, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

for axis in tp.active_frame().plot().axes:
    grid_lines = axis.grid_lines
    grid_lines.show = True

    minor_grid_lines = axis.minor_grid_lines
    minor_grid_lines.show = True
    minor_grid_lines.line_pattern = LinePattern.Dotted
    minor_grid_lines.color = Color.Green

tp.export.save_png('minor_grid_lines.png', 600)
../_images/minor_grid_lines.png

Attributes

color Color of the grid lines to be drawn.
draw_last Draw grid behind all other plot elements.
line_pattern Pattern style of the grid lines to be drawn.
line_thickness Width of the grid lines to be drawn.
pattern_length Segment length of the repeated line pattern.
show Draw grid lines as tick locations.
MinorGridLines.color

Color of the grid lines to be drawn.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> grid_lines.color = Color.Blue
MinorGridLines.draw_last

Draw grid behind all other plot elements.

Type:boolean

Example usage:

>>> grid_lines.draw_last = True
MinorGridLines.line_pattern

Pattern style of the grid lines to be drawn.

Type:LinePattern

Possible values: Solid, Dashed, DashDot, Dotted, LongDash, DashDotDot.

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
MinorGridLines.line_thickness

Width of the grid lines to be drawn.

Type:float

Example usage:

>>> grid_lines.line_thickness = 0.5
MinorGridLines.pattern_length

Segment length of the repeated line pattern.

Type:float

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
>>> grid_lines.pattern_length = 3.5
MinorGridLines.show

Draw grid lines as tick locations.

Type:boolean

Example usage:

>>> grid_lines.show = True

PolarAngleGridLines

class tecplot.plot.PolarAngleGridLines(axis)[source]

Major grid lines along the theta axis.

The lines drawn are determined by the placement of minor tick marks along the axis. Example usage:

from os import path
import tecplot as tp
from tecplot.constant import PlotType, ThetaMode, LinePattern, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

plot = tp.active_frame().plot(PlotType.PolarLine)
plot.activate()

plot.axes.theta_axis.mode = ThetaMode.Radians
plot.axes.grid_area.fill_color = Color.Creme

for axis in plot.axes:
    grid_lines = axis.grid_lines
    grid_lines.show = True
    grid_lines.line_pattern = LinePattern.LongDash
    grid_lines.color = Color.Green

for lmap in plot.linemaps():
    lmap.show_in_legend = False
    lmap.line.line_pattern = LinePattern.Solid
    lmap.line.line_thickness = 0.8

tp.export.save_png('grid_lines_polar.png', 600)
../_images/grid_lines_polar.png

Attributes

color Color of the grid lines to be drawn.
draw_last Draw grid behind all other plot elements.
line_pattern Pattern style of the grid lines to be drawn.
line_thickness Width of the grid lines to be drawn.
pattern_length Segment length of the repeated line pattern.
radial_cutoff Minimum radial position of theta grid lines.
show Draw grid lines as tick locations.
PolarAngleGridLines.color

Color of the grid lines to be drawn.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> grid_lines.color = Color.Blue
PolarAngleGridLines.draw_last

Draw grid behind all other plot elements.

Type:boolean

Example usage:

>>> grid_lines.draw_last = True
PolarAngleGridLines.line_pattern

Pattern style of the grid lines to be drawn.

Type:LinePattern

Possible values: Solid, Dashed, DashDot, Dotted, LongDash, DashDotDot.

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
PolarAngleGridLines.line_thickness

Width of the grid lines to be drawn.

Type:float

Example usage:

>>> grid_lines.line_thickness = 0.5
PolarAngleGridLines.pattern_length

Segment length of the repeated line pattern.

Type:float

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
>>> grid_lines.pattern_length = 3.5
PolarAngleGridLines.radial_cutoff

Minimum radial position of theta grid lines.

Type:float in percent along r-axis.

Example usage:

>>> plot.axes.theta_axis.grid_lines.radial_cutoff = 5
PolarAngleGridLines.show

Draw grid lines as tick locations.

Type:boolean

Example usage:

>>> grid_lines.show = True

PolarAngleMinorGridLines

class tecplot.plot.PolarAngleMinorGridLines(axis)[source]

Minor grid lines along the theta axis.

The lines drawn are determined by the placement of minor tick marks along the axis. Example usage:

from os import path
import tecplot as tp
from tecplot.constant import PlotType, ThetaMode, LinePattern, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

plot = tp.active_frame().plot(PlotType.PolarLine)
plot.activate()

plot.axes.theta_axis.mode = ThetaMode.Radians
plot.axes.grid_area.fill_color = Color.Creme

for axis in plot.axes:
    grid_lines = axis.grid_lines
    grid_lines.show = True

    minor_grid_lines = axis.minor_grid_lines
    minor_grid_lines.show = True
    minor_grid_lines.line_pattern = LinePattern.Dotted
    minor_grid_lines.color = Color.Green

for lmap in plot.linemaps():
    lmap.show_in_legend = False
    lmap.line.line_pattern = LinePattern.Solid
    lmap.line.line_thickness = 0.8

tp.export.save_png('minor_grid_lines_polar.png', 600)
../_images/minor_grid_lines_polar.png

Attributes

color Color of the grid lines to be drawn.
draw_last Draw grid behind all other plot elements.
line_pattern Pattern style of the grid lines to be drawn.
line_thickness Width of the grid lines to be drawn.
pattern_length Segment length of the repeated line pattern.
radial_cutoff Minimum radial position of theta grid lines.
show Draw grid lines as tick locations.
PolarAngleMinorGridLines.color

Color of the grid lines to be drawn.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> grid_lines.color = Color.Blue
PolarAngleMinorGridLines.draw_last

Draw grid behind all other plot elements.

Type:boolean

Example usage:

>>> grid_lines.draw_last = True
PolarAngleMinorGridLines.line_pattern

Pattern style of the grid lines to be drawn.

Type:LinePattern

Possible values: Solid, Dashed, DashDot, Dotted, LongDash, DashDotDot.

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
PolarAngleMinorGridLines.line_thickness

Width of the grid lines to be drawn.

Type:float

Example usage:

>>> grid_lines.line_thickness = 0.5
PolarAngleMinorGridLines.pattern_length

Segment length of the repeated line pattern.

Type:float

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
>>> grid_lines.pattern_length = 3.5
PolarAngleMinorGridLines.radial_cutoff

Minimum radial position of theta grid lines.

Type:float in percent along r-axis.

Example usage:

>>> plot.axes.theta_axis.grid_lines.radial_cutoff = 5
PolarAngleMinorGridLines.show

Draw grid lines as tick locations.

Type:boolean

Example usage:

>>> grid_lines.show = True

MarkerGridLine

class tecplot.plot.MarkerGridLine(axis)[source]

Marker line to indicate a particular position along an axis.

from os import path
import tecplot as tp
from tecplot.constant import PlotType, Color

exdir = tp.session.tecplot_examples_directory()
datafile = path.join(exdir, 'XY', 'line_plots_ind_v_dep_var.lpk')
dataset = tp.load_layout(datafile)

plot = tp.active_frame().plot(PlotType.XYLine)
plot.activate()

marker = plot.axes.x_axis(0).marker_grid_line
marker.show = True
marker.position = -0.4
marker.color = Color.Blue

marker = plot.axes.y_axis(0).marker_grid_line
marker.show = True
marker.position = -0.88
marker.color = Color.Blue

tp.export.save_png('marker_grid_line.png', 600)
../_images/marker_grid_line.png

Attributes

color Color of the grid lines to be drawn.
draw_last Draw grid behind all other plot elements.
line_pattern Pattern style of the grid lines to be drawn.
line_thickness Width of the grid lines to be drawn.
pattern_length Segment length of the repeated line pattern.
position Position of the marker line in axes coordinates.
show Draw grid lines as tick locations.
MarkerGridLine.color

Color of the grid lines to be drawn.

Type:Color

Example usage:

>>> from tecplot.constant import Color
>>> grid_lines.color = Color.Blue
MarkerGridLine.draw_last

Draw grid behind all other plot elements.

Type:boolean

Example usage:

>>> grid_lines.draw_last = True
MarkerGridLine.line_pattern

Pattern style of the grid lines to be drawn.

Type:LinePattern

Possible values: Solid, Dashed, DashDot, Dotted, LongDash, DashDotDot.

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
MarkerGridLine.line_thickness

Width of the grid lines to be drawn.

Type:float

Example usage:

>>> grid_lines.line_thickness = 0.5
MarkerGridLine.pattern_length

Segment length of the repeated line pattern.

Type:float

Example usage:

>>> from tecplot.constant import LinePattern
>>> grid_lines.line_pattern = LinePattern.LongDash
>>> grid_lines.pattern_length = 3.5
MarkerGridLine.position

Position of the marker line in axes coordinates.

Type:float or PositionMarkerBy.SolutionTime

The position can be set to a constant or to the solution time of the linked frame:

>>> from tecplot.constant import PositionMarkerBy
>>> marker_line = plot.axes.x_axis.marker_grid_line
>>> marker_line.position = PositionMarkerBy.SolutionTime
MarkerGridLine.show

Draw grid lines as tick locations.

Type:boolean

Example usage:

>>> grid_lines.show = True