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, 'SimpleData', 'HeatExchanger.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.axes.precise_grid.size = 0.05 plot.view.fit() # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() tp.export.save_png('axes_2d.png', 600, supersample=3)
Attributes
auto_adjust_ranges
Automatically adjust axis ranges to nice values. axis_mode
Controls automatic adjustment of axis ranges. 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 in percent. y_axis
Y-axis style control.
-
Cartesian2DFieldAxes.
auto_adjust_ranges
¶ Automatically adjust axis ranges to nice values.
Axes limits will be adjusted to have the smallest number of significant digits possible:
>>> plot.axes.auto_adjust_ranges = False
Type: bool
-
Cartesian2DFieldAxes.
axis_mode
¶ Controls automatic adjustment of axis ranges.
Possible values:
Independent
,XYDependent
.If set to
XYDependent
, then setting the range of one axis automatically scales the other indicated axes proportionally to maintain the aspect ratio of the plot, effectively zooming in or out. If set toIndependent
, adjusting the range of one axis has no effect on other axes. Defaults toIndependent
for XY line plots,XYDependent
for 2D Cartesian plots. Example usage:>>> from tecplot.constant import AxisMode >>> plot.axes.axis_mode = AxisMode.Independent
Type: AxisMode
-
Cartesian2DFieldAxes.
grid_area
¶ Area bounded by the axes.
This controls the background color and border of the axes:
>>> from tecplot.constant import Color >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: GridArea
-
Cartesian2DFieldAxes.
precise_grid
¶ Precise dot grid.
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
Type: PreciseGrid
-
Cartesian2DFieldAxes.
preserve_scale
¶ Preserve scale (spacing between ticks) on range change.
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)
Type: bool
-
Cartesian2DFieldAxes.
viewport
¶ Area of the frame used by the plot axes.
Example usage:
>>> plot.axes.viewport.left = 5 >>> plot.axes.viewport.right = 95 >>> plot.axes.viewport.top = 95 >>> plot.axes.viewport.bottom = 5
Type: Cartesian2DViewport
-
Cartesian2DFieldAxes.
x_axis
¶ X-axis style control.
Example usage:
>>> plot.axes.x_axis.show = False
Type: Cartesian2DFieldAxis
-
Cartesian2DFieldAxes.
xy_ratio
¶ X:Y axis scaling ratio 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
Type: float
-
Cartesian2DFieldAxes.
y_axis
¶ Y-axis style control.
Example usage:
>>> plot.axes.y_axis.show = False
Type: Cartesian2DFieldAxis
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, AxisTitleMode examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'HeatExchanger.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.title.title_mode = AxisTitleMode.UseText 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.title.title_mode = AxisTitleMode.UseText 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 # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() tp.export.save_png('axis_2d.png',600, supersample=3)
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
()Rounds the axis range to the nearest major axis increment. fit_range
([consider_blanking])Set range of axis to variable minimum and maximum. fit_range_to_nice
([consider_blanking])Set range of axis to nice values near variable minimum and maximum.
-
Cartesian2DFieldAxis.
adjust_range_to_nice
()¶ Rounds the axis range to the nearest major axis increment.
This method resets the axis-line label values such that all currently displayed label values are set to have the smallest number of significant digits possible.
Example usage:
>>> # 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
(consider_blanking=True)¶ Set range of axis to variable minimum and maximum.
Note
If the axis dependency is not
Independent
, then this action may also affect the range on another axis.Parameters: consider_blanking ( Boolean
, optional) – IfTrue
and blanking is enabled, the resulting view excludes blanked cells at the edges of the plot. IfFalse
, then the resulting view will ignore blanked cells at the edges of the plot. (default:True
)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
(consider_blanking=True)¶ 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,
Note
If the axis dependency is not independent then this method may also affect the range on another axis.
Parameters: consider_blanking ( Boolean
, optional) – IfTrue
and blanking is enabled, the resulting view excludes blanked cells at the edges of the plot. IfFalse
, then the resulting view will ignore blanked cells at the edges of the plot. (default:True
)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_to_nice()
-
Cartesian2DFieldAxis.
grid_lines
¶ Major grid lines style control.
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
Type: GridLines2D
-
Cartesian2DFieldAxis.
line
¶ Axis line style control.
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
Type: Cartesian2DAxisLine
-
Cartesian2DFieldAxis.
log_scale
¶ Use logarithmic scale for this axis.
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
Type: bool
-
Cartesian2DFieldAxis.
marker_grid_line
¶ Marker line to indicate a particular position along an axis.
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
Type: MarkerGridLine2D
-
Cartesian2DFieldAxis.
max
¶ Upper bound of this axis’ range.
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
Type: float
-
Cartesian2DFieldAxis.
min
¶ Lower bound of this axis’ range.
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
Type: float
-
Cartesian2DFieldAxis.
minor_grid_lines
¶ Minor grid lines style control.
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
Type: MinorGridLines2D
-
Cartesian2DFieldAxis.
reverse
¶ Reverse the direction of the axis scale.
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
Type: bool
-
Cartesian2DFieldAxis.
show
¶ Enable drawing of this axis.
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
Type: bool
-
Cartesian2DFieldAxis.
tick_labels
¶ Axis ticks labels style control.
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
Type: TickLabels2D
-
Cartesian2DFieldAxis.
ticks
¶ Axis major and minor ticks style control.
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
Type: Ticks2D
-
Cartesian2DFieldAxis.
title
¶ Axis title.
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)'
Type: str
-
Cartesian2DFieldAxis.
variable
¶ The
Variable
assigned to this axis.This is the spatial variable associated with this axis and is usually one of
(X, Y, Z)
. Example usage:import tecplot as tp from tecplot.constant import PlotType fr = tp.active_frame() ds = fr.create_dataset('D', ['X', 'Y', 'Z', 'U', 'V']) axes = fr.plot(PlotType.Cartesian3D).axes # prints: ('X', 'Y') print(axes.x_axis.variable.name, axes.y_axis.variable.name) axes.x_axis.variable = ds.variable('U') axes.y_axis.variable = ds.variable('V') # prints: ('U', 'V) print(axes.x_axis.variable.name, axes.y_axis.variable.name)
Type: Variable
-
Cartesian2DFieldAxis.
variable_index
¶ Index of the
Variable
assigned to this axis.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
Type: Index
(zero-based)
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, 'SimpleData', '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, supersample=3)
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.auto_edge_assignment
Enable automatically choosing which edges to label. axis_mode
Scale dependencies along each axis. grid_area
Area of the viewport used by the axes. orientation_axis
Get the 3D Orientation Axes. padding
Margin of axis padding around data in percent of data extent. 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 in percent. xz_ratio
X:Z axis scaling ratio in percent. y_axis
Y-axis style control. z_axis
Z-axis style control. Methods
reset_origin
([location])Set the origin to the specified location. reset_range
()Recalculate and set the ranges for each axis. reset_scale
()Recalculate and set the scale factors for each axis.
-
Cartesian3DFieldAxes.
aspect_ratio_limit
¶ Scale limit of the axes aspect ratio.
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()
Type: float
-
Cartesian3DFieldAxes.
aspect_ratio_reset
¶ Axes scale aspect ratio used when
aspect_ratio_limit
is exceeded.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()
Type: float
-
Cartesian3DFieldAxes.
auto_edge_assignment
¶ Enable automatically choosing which edges to label.
Example usage:
>>> plot.axes.auto_edge_assignment = True
Type: bool
-
Cartesian3DFieldAxes.
axis_mode
¶ Scale dependencies along each axis.
Possible values:
Independent
,XYDependent
,XYZDependent
.If set to
XYDependent
orXYZDependent
, then setting the range of one axis automatically scales the other indicated axes proportionally to maintain the aspect ratio of the plot, effectively zooming in or out. If set toIndependent
, adjusting the range of one axis has no effect on other axes. Defaults toXYZDependent
for 3D Cartesian plots. Both dependent modes allow 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
Type: AxisMode
-
Cartesian3DFieldAxes.
grid_area
¶ Area of the viewport used by the axes.
Example usage:
>>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: Cartesian3DGridArea
-
Cartesian3DFieldAxes.
orientation_axis
¶ Get the 3D Orientation Axes.
Example usage:
>>> # Hide the orientation axes >>> plot.axes.orientation_axis.show = False
Type: OrientationAxis
-
Cartesian3DFieldAxes.
padding
¶ Margin of axis padding around data in percent of data extent.
Example usage:
>>> plot.axes.padding = 5
Type: float
-
Cartesian3DFieldAxes.
preserve_scale
¶ Preserve scale (spacing between ticks) on range change.
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)
Type: bool
-
Cartesian3DFieldAxes.
range_aspect_ratio_limit
¶ Range limit of the axes aspect ratio.
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_range()
Type: float
-
Cartesian3DFieldAxes.
range_aspect_ratio_reset
¶ Axes range aspect ratio used
range_aspect_ratio_limit
is exceeded.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_range()
Type: float
-
Cartesian3DFieldAxes.
reset_origin
(location=<OriginResetLocation.DataCenter: 0>)¶ Set the origin to the specified location.
Parameters: location ( OriginResetLocation
, optional) – Either the center of the data withOriginResetLocation.DataCenter
(default) or the center of the viewport withOriginResetLocation.ViewCenter
.Example usage:
>>> from tecplot.constant import OriginResetLocation >>> plot.axes.reset_origin(OriginResetLocation.ViewCenter)
-
Cartesian3DFieldAxes.
reset_range
()¶ Recalculate and set the ranges for each axis.
Example usage:
>>> plot.axes.reset_range()
-
Cartesian3DFieldAxes.
reset_scale
()¶ Recalculate and set 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.
Example usage:
>>> print(plot.axes.viewport.bottom) 5
Type: ReadOnlyViewport
-
Cartesian3DFieldAxes.
x_axis
¶ X-axis style control.
Example usage:
>>> plot.axes.x_axis.show = True
Type: Cartesian3DFieldAxis
-
Cartesian3DFieldAxes.
xy_ratio
¶ X:Y axis scaling ratio 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
Type: float
-
Cartesian3DFieldAxes.
xz_ratio
¶ X:Z axis scaling ratio 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
Type: float
-
Cartesian3DFieldAxes.
y_axis
¶ Y-axis style control.
Example usage:
>>> plot.axes.y_axis.show = True
Type: Cartesian3DFieldAxis
-
Cartesian3DFieldAxes.
z_axis
¶ Z-axis style control.
Example usage:
>>> plot.axes.z_axis.show = True
Type: Cartesian3DFieldAxis
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, 'SimpleData', 'RainierElevation.lay') tp.load_layout(infile) frame = tp.active_frame() dataset = frame.dataset plot = frame.plot(PlotType.Cartesian3D) plot.activate() plot.show_contour = True plot.axes.grid_area.filled = False 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.axes.y_axis.min=-2000 plot.axes.y_axis.max=1000 plot.axes.x_axis.min=-9500 plot.axes.x_axis.max=-7200 plot.axes.z_axis.min=0 plot.axes.x_axis.scale_factor=1.9 plot.view.width = 7830 plot.view.alpha = 0 plot.view.theta = -147.5 plot.view.psi = 70 plot.view.position = (1975, 15620, 115930) tp.export.save_png('axis_3d.png', 600, supersample=3)
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
()Rounds the axis range to the nearest major axis increment. fit_range
([consider_blanking])Set range of axis to variable minimum and maximum. fit_range_to_nice
([consider_blanking])Set range of axis to nice values near variable minimum and maximum.
-
Cartesian3DFieldAxis.
adjust_range_to_nice
()¶ Rounds the axis range to the nearest major axis increment.
This method resets the axis-line label values such that all currently displayed label values are set to have the smallest number of significant digits possible.
Example usage:
>>> # 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
(consider_blanking=True)¶ Set range of axis to variable minimum and maximum.
Note
If the axis dependency is not
Independent
, then this action may also affect the range on another axis.Parameters: consider_blanking ( Boolean
, optional) – IfTrue
and blanking is enabled, the resulting view excludes blanked cells at the edges of the plot. IfFalse
, then the resulting view will ignore blanked cells at the edges of the plot. (default:True
)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
(consider_blanking=True)¶ 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,
Note
If the axis dependency is not independent then this method may also affect the range on another axis.
Parameters: consider_blanking ( Boolean
, optional) – IfTrue
and blanking is enabled, the resulting view excludes blanked cells at the edges of the plot. IfFalse
, then the resulting view will ignore blanked cells at the edges of the plot. (default:True
)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_to_nice()
-
Cartesian3DFieldAxis.
grid_lines
¶ Major grid lines style control.
Major grid lines are attached to the locations of the major ticks. See
minor_grid_lines
for lines attached to minor ticks. Example usage:>>> plot.axes.x_axis.grid_lines.show = True
Type: GridLines
-
Cartesian3DFieldAxis.
line
¶ Axis line style control.
Example usage:
>>> plot.axes.x_axis.line.line_thickness = 0.6
Type: AxisLine3D
-
Cartesian3DFieldAxis.
marker_grid_line
¶ Marker line to indicate a particular position along an axis.
Example usage:
>>> plot.axes.x_axis.marker_grid_line.show = True >>> plot.axes.x_axis.marker_grid_line.position = 0.5
Type: MarkerGridLine
-
Cartesian3DFieldAxis.
max
¶ Upper bound of this axis’ range.
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
Type: float
-
Cartesian3DFieldAxis.
min
¶ Lower bound of this axis’ range.
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
Type: float
-
Cartesian3DFieldAxis.
minor_grid_lines
¶ Minor grid lines style control.
Minor grid lines are attached to the locations of the minor ticks. Example usage:
>>> plot.axes.x_axis.minor_grid_lines.show = True
Type: MinorGridLines
-
Cartesian3DFieldAxis.
scale_factor
¶ Factor used for axis scaling.
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
Type: float
-
Cartesian3DFieldAxis.
show
¶ Enable drawing of this axis.
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
Type: bool
-
Cartesian3DFieldAxis.
tick_labels
¶ Axis ticks labels style control.
Example usage:
>>> plot.axes.x_axis.tick_labels.show = False
Type: TickLabels3D
-
Cartesian3DFieldAxis.
ticks
¶ Axis major and minor ticks style control.
Example usage:
>>> plot.axes.x_axis.ticks.line_thickness = 0.8
Type: Ticks3D
-
Cartesian3DFieldAxis.
title
¶ Axis title.
This is the primary label for the axis and usually includes units:
>>> plot.axes.x_axis.title.text = 'distance (m)'
Type: str
-
Cartesian3DFieldAxis.
variable
¶ The
Variable
assigned to this axis.This is the spatial variable associated with this axis and is usually one of
(X, Y, Z)
. Example usage:import tecplot as tp from tecplot.constant import PlotType fr = tp.active_frame() ds = fr.create_dataset('D', ['X', 'Y', 'Z', 'U', 'V']) axes = fr.plot(PlotType.Cartesian3D).axes # prints: ('X', 'Y') print(axes.x_axis.variable.name, axes.y_axis.variable.name) axes.x_axis.variable = ds.variable('U') axes.y_axis.variable = ds.variable('V') # prints: ('U', 'V) print(axes.x_axis.variable.name, axes.y_axis.variable.name)
Type: Variable
-
Cartesian3DFieldAxis.
variable_index
¶ Index of the
Variable
assigned to this axis.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
Type: Index
(zero-based)
Line Axes¶
XYLineAxes¶
-
class
tecplot.plot.
XYLineAxes
(plot)[source]¶ (X, Y) axes style control for line plots.
The
axes
property of aXYLinePlot
allows access to the severalx
andy
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.values('Position (m)')[:] = x zone.values('Temperature (K)')[:] = t zone.values('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, supersample=3)
Attributes
auto_adjust_ranges
Automatically adjust axis ranges to nice values. axis_mode
Controls automatic adjustment of axis ranges. 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 in percent. Methods
x_axis
(index)XYLineAxis
: X-axis style control.y_axis
(index)XYLineAxis
: Y-axis style control.
-
XYLineAxes.
auto_adjust_ranges
¶ Automatically adjust axis ranges to nice values.
Axes limits will be adjusted to have the smallest number of significant digits possible:
>>> plot.axes.auto_adjust_ranges = False
Type: bool
-
XYLineAxes.
axis_mode
¶ Controls automatic adjustment of axis ranges.
Possible values:
Independent
,XYDependent
.If set to
XYDependent
, then setting the range of one axis automatically scales the other indicated axes proportionally to maintain the aspect ratio of the plot, effectively zooming in or out. If set toIndependent
, adjusting the range of one axis has no effect on other axes. Defaults toIndependent
for XY line plots,XYDependent
for 2D Cartesian plots. Example usage:>>> from tecplot.constant import AxisMode >>> plot.axes.axis_mode = AxisMode.Independent
Type: AxisMode
-
XYLineAxes.
grid_area
¶ Area bounded by the axes.
This controls the background color and border of the axes:
>>> from tecplot.constant import Color >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: GridArea
-
XYLineAxes.
precise_grid
¶ Precise dot grid.
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
Type: PreciseGrid
-
XYLineAxes.
preserve_scale
¶ Preserve scale (spacing between ticks) on range change.
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)
Type: bool
-
XYLineAxes.
viewport
¶ Area of the frame used by the plot axes.
Example usage:
>>> plot.axes.viewport.left = 5 >>> plot.axes.viewport.right = 95 >>> plot.axes.viewport.top = 95 >>> plot.axes.viewport.bottom = 5
Type: Cartesian2DViewport
-
XYLineAxes.
x_axis
(index)[source]¶ XYLineAxis
: X-axis style control.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 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
Type: float
-
XYLineAxes.
y_axis
(index)[source]¶ XYLineAxis
: Y-axis style control.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 examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) plot = tp.active_frame().plot(PlotType.XYLine) plot.activate() for i in range(2): 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.color = lmap.line.color yax.title.color = lmap.line.color yax.tick_labels.color = lmap.line.color yax.line.line_thickness = 0.6 if i == 0: yax.grid_lines.show = True yax.grid_lines.color = lmap.line.color elif i == 1: yax.minor_grid_lines.show = True yax.minor_grid_lines.color = lmap.line.color tp.export.save_png('axis_line.png', 600, supersample=3)
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
()Rounds the axis range to the nearest major axis increment. 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
()¶ Rounds the axis range to the nearest major axis increment.
This method resets the axis-line label values such that all currently displayed label values are set to have the smallest number of significant digits possible.
Example usage:
>>> # 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.
Note
If the axis dependency is not
Independent
, then this action may also affect the range on another axis.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,
Note
If the axis dependency is not independent then this method may also affect the range on another axis.
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_to_nice()
-
XYLineAxis.
grid_lines
¶ Major grid lines style control.
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
Type: GridLines2D
-
XYLineAxis.
line
¶ Axis line style control.
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
Type: Cartesian2DAxisLine
-
XYLineAxis.
log_scale
¶ Use logarithmic scale for this axis.
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
Type: bool
-
XYLineAxis.
marker_grid_line
¶ Marker line to indicate a particular position along an axis.
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
Type: MarkerGridLine2D
-
XYLineAxis.
max
¶ Upper bound of this axis’ range.
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
Type: float
-
XYLineAxis.
min
¶ Lower bound of this axis’ range.
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
Type: float
-
XYLineAxis.
minor_grid_lines
¶ Minor grid lines style control.
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
Type: MinorGridLines2D
-
XYLineAxis.
reverse
¶ Reverse the direction of the axis scale.
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
Type: bool
-
XYLineAxis.
show
¶ Enable drawing of this axis.
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
Type: bool
-
XYLineAxis.
tick_labels
¶ Axis ticks labels style control.
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
Type: TickLabels2D
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.values('R')[:] = r zone.values('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, supersample=3)
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.
-
PolarLineAxes.
grid_area
¶ Area bounded by the axes.
This controls the background color and border of the axes:
>>> from tecplot.constant import Color >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: GridArea
-
PolarLineAxes.
precise_grid
¶ Precise dot grid.
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
Type: PreciseGrid
-
PolarLineAxes.
preserve_scale
¶ Preserve scale (spacing between ticks) on range change.
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)
Type: bool
-
PolarLineAxes.
r_axis
¶ Radial axis style control.
Example usage:
>>> plot.axes.r_axis.title.text = 'R (meters)'
Type: RadialLineAxis
-
PolarLineAxes.
theta_axis
¶ Polar-angle axis style control.
Example usage:
>>> plot.axes.theta_axis.title.text = 'Theta (radians)'
Type: PolarAngleLineAxis
-
PolarLineAxes.
viewport
¶ Area of the frame used by the plot axes outside the grid area.
Example usage:
>>> from tecplot.constant import Color >>> plot.axes.viewport.fill_color = Color.LightGreen
Type: PolarViewport
RadialLineAxis¶
-
class
tecplot.plot.
RadialLineAxis
(axes)[source]¶ The R axis for polar plots
See the example shown for the
theta axis
.Attributes
clip_data
Do not show data outside the axes area. 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
()Rounds the axis range to the nearest major axis increment. 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
()¶ Rounds the axis range to the nearest major axis increment.
This method resets the axis-line label values such that all currently displayed label values are set to have the smallest number of significant digits possible.
Example usage:
>>> # 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.
clip_data
¶ Do not show data outside the axes area.
Example usage:
>>> plot.axes.clip_data = True
Type: bool
-
RadialLineAxis.
fit_range
()¶ Set range of axis to variable minimum and maximum.
Note
If the axis dependency is not
Independent
, then this action may also affect the range on another axis.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,
Note
If the axis dependency is not independent then this method may also affect the range on another axis.
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_to_nice()
-
RadialLineAxis.
grid_lines
¶ Major grid lines style control.
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
Type: GridLines2D
-
RadialLineAxis.
line
¶ Radial axis line style control.
Example usage:
>>> plot.axes.r_axis.line.line_thickness = 0.6
Type: RadialAxisLine2D
-
RadialLineAxis.
log_scale
¶ Use logarithmic scale for this axis.
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
Type: bool
-
RadialLineAxis.
marker_grid_line
¶ Marker line to indicate a particular position along an axis.
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
Type: MarkerGridLine2D
-
RadialLineAxis.
max
¶ Upper bound of this axis’ range.
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
Type: float
-
RadialLineAxis.
min
¶ Lower bound of this axis’ range.
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
Type: float
-
RadialLineAxis.
minor_grid_lines
¶ Minor grid lines style control.
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
Type: MinorGridLines2D
-
RadialLineAxis.
origin
¶ Value at the origin of the axis.
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
Type: float
-
RadialLineAxis.
reverse
¶ Reverse the direction of the axis scale.
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
Type: bool
-
RadialLineAxis.
show
¶ Enable drawing of this axis.
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
Type: bool
-
RadialLineAxis.
tick_labels
¶ Axis ticks labels style control.
Example usage:
>>> plot.axes.r_axis.tick_labels.show = False
Type: RadialTickLabels
-
RadialLineAxis.
ticks
¶ Axis major and minor ticks style control.
Example usage:
>>> plot.axes.r_axis.ticks.line_thickness = 0.8
Type: RadialTicks
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.values('Magnitude')[:] = r zone.values('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.auto_spacing = False 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, supersample=3)
Attributes
clip_data
Do not show data outside the axes area. grid_lines
Theta angle major grid lines. line
Axis line style control. marker_grid_line
Theta angle marker grid line. max
Upper bound of this axis’ range. min
Lower bound of this axis’ range. minor_grid_lines
Theta angle 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
()Rounds the axis range to the nearest major axis increment. 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
()¶ Rounds the axis range to the nearest major axis increment.
This method resets the axis-line label values such that all currently displayed label values are set to have the smallest number of significant digits possible.
Example usage:
>>> # 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.
clip_data
¶ Do not show data outside the axes area.
Example usage:
>>> plot.axes.clip_data = True
Type: bool
-
PolarAngleLineAxis.
fit_range
()¶ Set range of axis to variable minimum and maximum.
Note
If the axis dependency is not
Independent
, then this action may also affect the range on another axis.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,
Note
If the axis dependency is not independent then this method may also affect the range on another axis.
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_to_nice()
-
PolarAngleLineAxis.
grid_lines
¶ Theta angle major grid lines.
Example usage:
>>> plot.axes.theta_axis.grid_lines.show = True
Type: PolarAngleGridLines
-
PolarAngleLineAxis.
line
¶ Axis line style control.
Example usage:
>>> plot.axes.r_axis.line.line_thickness = 0.6 >>> plot.axes.theta_axis.line.line_thickness = 0.6
Type: AxisLine2D
-
PolarAngleLineAxis.
marker_grid_line
¶ Theta angle marker grid line.
Example usage:
>>> plot.axes.theta_axis.marker_grid_line.show = True
Type: PolarAngleMarkerGridLine
-
PolarAngleLineAxis.
max
¶ Upper bound of this axis’ range.
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
Type: float
-
PolarAngleLineAxis.
min
¶ Lower bound of this axis’ range.
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
Type: float
-
PolarAngleLineAxis.
minor_grid_lines
¶ Theta angle minor grid lines.
Example usage:
>>> plot.axes.theta_axis.minor_grid_lines.show = True
Type: PolarAngleMinorGridLines
-
PolarAngleLineAxis.
mode
¶ Units or scale used for the theta axis.
Possible values:
ThetaMode.Degrees
,ThetaMode.Radians
,ThetaMode.Arbitrary
.Example usage:
>>> from tecplot.constant import ThetaMode >>> plot.axes.theta_axis.mode = ThetaMode.Radians
Type: ThetaMode
-
PolarAngleLineAxis.
origin
¶ Value at the origin of the axis.
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
Type: float
-
PolarAngleLineAxis.
period
¶ Number of (min, max) cycles to include in 360 degrees.
Example usage:
>>> plot.axes.theta_axis.period = 2
Type: float
-
PolarAngleLineAxis.
reverse
¶ Reverse the direction of the axis scale.
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
Type: bool
-
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.
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
Type: bool
-
PolarAngleLineAxis.
tick_labels
¶ Axis ticks labels style control.
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
Type: TickLabels2D
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, supersample=3)
Attributes
auto_adjust_ranges
Automatically adjust axis ranges to nice values. axis_mode
Controls automatic adjustment of axis ranges. 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 in percent. y_axis
Y-axis style control.
-
SketchAxes.
auto_adjust_ranges
¶ Automatically adjust axis ranges to nice values.
Axes limits will be adjusted to have the smallest number of significant digits possible:
>>> plot.axes.auto_adjust_ranges = False
Type: bool
-
SketchAxes.
axis_mode
¶ Controls automatic adjustment of axis ranges.
Possible values:
Independent
,XYDependent
.If set to
XYDependent
, then setting the range of one axis automatically scales the other indicated axes proportionally to maintain the aspect ratio of the plot, effectively zooming in or out. If set toIndependent
, adjusting the range of one axis has no effect on other axes. Defaults toIndependent
for XY line plots,XYDependent
for 2D Cartesian plots. Example usage:>>> from tecplot.constant import AxisMode >>> plot.axes.axis_mode = AxisMode.Independent
Type: AxisMode
-
SketchAxes.
grid_area
¶ Area bounded by the axes.
This controls the background color and border of the axes:
>>> from tecplot.constant import Color >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: GridArea
-
SketchAxes.
precise_grid
¶ Precise dot grid.
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
Type: PreciseGrid
-
SketchAxes.
preserve_scale
¶ Preserve scale (spacing between ticks) on range change.
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)
Type: bool
-
SketchAxes.
viewport
¶ Area of the frame used by the plot axes.
Example usage:
>>> plot.axes.viewport.left = 5 >>> plot.axes.viewport.right = 95 >>> plot.axes.viewport.top = 95 >>> plot.axes.viewport.bottom = 5
Type: Cartesian2DViewport
-
SketchAxes.
x_axis
¶ X-axis style control.
Example usage:
>>> plot.axes.x_axis.show = True
Type: SketchAxis
-
SketchAxes.
xy_ratio
¶ X:Y axis scaling ratio 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
Type: float
-
SketchAxes.
y_axis
¶ Y-axis style control.
Example usage:
>>> plot.axes.y_axis.show = True
Type: SketchAxis
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.auto_spacing = False xaxis.ticks.spacing = 60 tp.export.save_png('axis_sketch.png', 600, supersample=3)
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
()Rounds the axis range to the nearest major axis increment. 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
()¶ Rounds the axis range to the nearest major axis increment.
This method resets the axis-line label values such that all currently displayed label values are set to have the smallest number of significant digits possible.
Example usage:
>>> # 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.
Note
If the axis dependency is not
Independent
, then this action may also affect the range on another axis.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,
Note
If the axis dependency is not independent then this method may also affect the range on another axis.
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_to_nice()
-
SketchAxis.
grid_lines
¶ Major grid lines style control.
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
Type: GridLines2D
-
SketchAxis.
line
¶ Axis line style control.
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
Type: Cartesian2DAxisLine
-
SketchAxis.
log_scale
¶ Use logarithmic scale for this axis.
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
Type: bool
-
SketchAxis.
marker_grid_line
¶ Marker line to indicate a particular position along an axis.
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
Type: MarkerGridLine2D
-
SketchAxis.
max
¶ Upper bound of this axis’ range.
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
Type: float
-
SketchAxis.
min
¶ Lower bound of this axis’ range.
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
Type: float
-
SketchAxis.
minor_grid_lines
¶ Minor grid lines style control.
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
Type: MinorGridLines2D
-
SketchAxis.
show
¶ Enable drawing of this axis.
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
Type: bool
-
SketchAxis.
tick_labels
¶ Axis ticks labels style control.
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
Type: TickLabels2D
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:import numpy as np import tecplot as tp from tecplot.constant import PlotType, ThetaMode npoints = 300 r = np.linspace(0, 2000, npoints) theta = np.linspace(0, 10, npoints) frame = tp.active_frame() dataset = frame.create_dataset('Data', ['R', 'Theta']) zone = dataset.add_ordered_zone('Zone', (300,)) zone.values('R')[:] = r zone.values('Theta')[:] = theta plot = frame.plot(PlotType.PolarLine) plot.activate() plot.delete_linemaps() lmap = plot.add_linemap('Linemap', zone, dataset.variable('R'), dataset.variable('Theta')) lmap.line.line_thickness = 0.8 r_axis = plot.axes.r_axis r_axis.max = np.max(r) r_axis.tick_labels.angle = 45 r_axis.tick_labels.font.size *= 2 theta_axis = plot.axes.theta_axis theta_axis.mode = ThetaMode.Radians theta_axis.tick_labels.font.size *= 2 plot.view.fit() tp.export.save_png('axis_line_2d.png', 600, supersample=3)
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.
Possible values:
WithViewport
,WithOpposingAxisValue
,WithGridMin
,WithGridMax
,WithGridAreaTop
,WithGridAreaBottom
,WithGridAreaLeft
orWithGridAreaRight
.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
Type: AxisAlignment
-
AxisLine2D.
color
¶ Color of the axis line.
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
Type: Color
-
AxisLine2D.
line_thickness
¶ Width of the axis line to be drawn.
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
Type: float
-
AxisLine2D.
offset
¶ Axis line placement with respect to the grid border.
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
Type: float
(percent of frame height)
-
AxisLine2D.
opposing_axis_value
¶ Axis line placement with respect to the opposing axis.
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
Type: float
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, 'SimpleData', 'CircularContour.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() for ax in plot.axes: line = ax.line line.color = Color.DeepRed line.alignment = AxisAlignment.WithOpposingAxisValue line.opposing_axis_value = 0 ax.title.position = 85 plot.contour(0).levels.reset_to_nice() tp.export.save_png('axis_line_cartesian2d.png', 600, supersample=3)
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.
Possible values:
WithViewport
,WithOpposingAxisValue
,WithGridMin
,WithGridMax
,WithGridAreaTop
,WithGridAreaBottom
,WithGridAreaLeft
orWithGridAreaRight
.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
Type: AxisAlignment
-
Cartesian2DAxisLine.
color
¶ Color of the axis line.
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
Type: Color
-
Cartesian2DAxisLine.
line_thickness
¶ Width of the axis line to be drawn.
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
Type: float
-
Cartesian2DAxisLine.
offset
¶ Axis line placement with respect to the grid border.
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
Type: float
(percent of frame height)
-
Cartesian2DAxisLine.
opposing_axis_value
¶ Axis line placement with respect to the opposing axis.
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
Type: float
-
Cartesian2DAxisLine.
position
¶ Axis line placement with respect to the viewport.
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
Type: float
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, 'SimpleData', 'Sphere.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, supersample=3)
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.
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
Type: Color
-
AxisLine3D.
edge_assignment
¶ Edge to use when drawing the primary axis line.
Possible values:
AxisLine3DAssignment.Automatic
(aliased toNone
),YMinZMin
,YMaxZMin
,YMinZMax
,YMaxZMax
.Example usage:
>>> from tecplot.constant import AxisLine3DAssignment >>> axis.line.edge_assignment = AxisLine3DAssignment.YMinZMin
Type: AxisLine3DAssignment
orNone
-
AxisLine3D.
line_thickness
¶ Width of the axis line to be drawn.
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
Type: float
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.values('R')[:] = r zone.values('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, supersample=3)
Attributes
alignment
Axis line placement. angle
Specific angle to place the radial axis line. 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.
Possible values:
WithOpposingAxisValue
,WithGridMin
,WithGridMax
,WithSpecificAngle
,WithGridAreaTop
,WithGridAreaBottom
,WithGridAreaLeft
orWithGridAreaRight
.Not all values will be available for every plot type. Example usage:
>>> from tecplot.constant import AxisAlignment >>> plot.r_axis.line.alignment = AxisAlignment.WithOpposingAxisValue >>> plot.r_axis.line.opposing_axis_value = 45
Type: AxisAlignment
-
RadialAxisLine2D.
angle
¶ Specific angle to place the radial axis line.
The alignment must be set to
AxisAlignment.WithSpecificAngle
:>>> from tecplot.constant import AxisAlignment >>> plot.r_axis.line.alignment = AxisAlignment.WithSpecificAngle >>> plot.r_axis.line.angle = 45
Type: float
-
RadialAxisLine2D.
color
¶ Color of the axis line.
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
Type: Color
-
RadialAxisLine2D.
line_thickness
¶ Width of the axis line to be drawn.
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
Type: float
-
RadialAxisLine2D.
offset
¶ Axis line placement with respect to the grid border.
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
Type: float
(percent of frame height)
-
RadialAxisLine2D.
opposing_axis_value
¶ Axis line placement with respect to the opposing axis.
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
Type: float
-
RadialAxisLine2D.
show
¶ Draw the primary axis line on the plot.
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
Type: bool
-
RadialAxisLine2D.
show_both_directions
¶ Mirror the radial axis 180 degrees from the primary line.
If
RadialAxisLine2D.show_perpendicular
isTrue
, 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
Type: bool
Ticks and Labels¶
Ticks2D¶
-
class
tecplot.plot.
Ticks2D
(axis)[source]¶ Tick marks (major and minor) along axes in 2D.
import tecplot as tp from os import path from tecplot.constant import PlotType, AxisMode, AxisAlignment, TickDirection examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'CircularContour.plt') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() plot = frame.plot(PlotType.Cartesian2D) plot.show_contour = True plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue' 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.auto_spacing = False ticks.spacing = 0.5 ticks.minor_num_ticks = 3 ticks.length *= 3 ticks.line_thickness *= 2 plot.view.fit() # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() tp.export.save_png('ticks_2d.png', 600, supersample=3)
Attributes
auto_spacing
Automatically set the spacing between tick marks. 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.
auto_spacing
¶ Automatically set the spacing between tick marks.
Example usage:
>>> axis.ticks.auto_spacing = True
Type: bool
-
Ticks2D.
direction
¶ How to draw the ticks with respect the axis line.
Possible values:
TickDirection.In
,TickDirection.Out
orTickDirection.Centered
:>>> from tecplot.constant import TickDirection >>> axis.ticks.direction = TickDirection.Centered
Type: TickDirection
-
Ticks2D.
length
¶ Size of the major tick lines to draw.
Example usage:
>>> axis.ticks.length = 2
Type: float
(percent of frame height)
-
Ticks2D.
line_thickness
¶ Width of the major tick lines to be drawn.
Example usage:
>>> axis.ticks.line_thickness = 0.4
Type: float
-
Ticks2D.
minor_length
¶ Size of the minor tick lines to draw.
Example usage:
>>> axis.ticks.minor_length = 1.2
Type: float
(percent of frame height)
-
Ticks2D.
minor_line_thickness
¶ Width of the minor tick lines to be drawn.
Example usage:
>>> axis.ticks.minor_line_thickness = 0.1
Type: float
-
Ticks2D.
minor_num_ticks
¶ Number of minor ticks between each major tick.
Example usage:
>>> axis.ticks.minor_num_ticks = 3
Type: int
-
Ticks2D.
show_on_border_max
¶ Draw ticks along the upper border of the axes grid.
Example usage:
>>> axis.ticks.show_on_border_max = True
Type: bool
-
Ticks2D.
show_on_border_min
¶ Draw ticks along the lower border of the axes grid.
Example usage:
>>> axis.ticks.show_on_border_min = True
Type: bool
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, 'SimpleData', 'F18.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.filled = False 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, supersample=3)
Attributes
auto_spacing
Automatically set the spacing between tick marks. 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.
auto_spacing
¶ Automatically set the spacing between tick marks.
Example usage:
>>> axis.ticks.auto_spacing = True
Type: bool
-
Ticks3D.
direction
¶ How to draw the ticks with respect the axis line.
Possible values:
TickDirection.In
,TickDirection.Out
orTickDirection.Centered
:>>> from tecplot.constant import TickDirection >>> axis.ticks.direction = TickDirection.Centered
Type: TickDirection
-
Ticks3D.
length
¶ Size of the major tick lines to draw.
Example usage:
>>> axis.ticks.length = 2
Type: float
(percent of frame height)
-
Ticks3D.
line_thickness
¶ Width of the major tick lines to be drawn.
Example usage:
>>> axis.ticks.line_thickness = 0.4
Type: float
-
Ticks3D.
minor_length
¶ Size of the minor tick lines to draw.
Example usage:
>>> axis.ticks.minor_length = 1.2
Type: float
(percent of frame height)
-
Ticks3D.
minor_line_thickness
¶ Width of the minor tick lines to be drawn.
Example usage:
>>> axis.ticks.minor_line_thickness = 0.1
Type: float
-
Ticks3D.
minor_num_ticks
¶ Number of minor ticks between each major tick.
Example usage:
>>> axis.ticks.minor_num_ticks = 3
Type: int
-
Ticks3D.
show_on_opposite_edge
¶ Draw ticks along the opposite border of the axes grid.
Example usage:
>>> axis.ticks.show_on_opposite_edge = True
Type: bool
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 examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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, supersample=3)
Attributes
auto_spacing
Automatically set the spacing between tick marks. 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.
auto_spacing
¶ Automatically set the spacing between tick marks.
Example usage:
>>> axis.ticks.auto_spacing = True
Type: bool
-
RadialTicks.
direction
¶ How to draw the ticks with respect the axis line.
Possible values:
TickDirection.In
,TickDirection.Out
orTickDirection.Centered
:>>> from tecplot.constant import TickDirection >>> axis.ticks.direction = TickDirection.Centered
Type: TickDirection
-
RadialTicks.
length
¶ Size of the major tick lines to draw.
Example usage:
>>> axis.ticks.length = 2
Type: float
(percent of frame height)
-
RadialTicks.
line_thickness
¶ Width of the major tick lines to be drawn.
Example usage:
>>> axis.ticks.line_thickness = 0.4
Type: float
-
RadialTicks.
minor_length
¶ Size of the minor tick lines to draw.
Example usage:
>>> axis.ticks.minor_length = 1.2
Type: float
(percent of frame height)
-
RadialTicks.
minor_line_thickness
¶ Width of the minor tick lines to be drawn.
Example usage:
>>> axis.ticks.minor_line_thickness = 0.1
Type: float
-
RadialTicks.
minor_num_ticks
¶ Number of minor ticks between each major tick.
Example usage:
>>> axis.ticks.minor_num_ticks = 3
Type: int
-
RadialTicks.
show_on_all_radial_axes
¶ Draw ticks along all radial axis lines.
Example usage:
>>> plot.axes.r_axis.line.show_perpendicular = True >>> plot.axes.r_axis.ticks.show_on_all_radial_axes = True
Type: bool
-
RadialTicks.
show_on_border_max
¶ Draw ticks along the upper border of the axes grid.
Example usage:
>>> axis.ticks.show_on_border_max = True
Type: bool
-
RadialTicks.
show_on_border_min
¶ Draw ticks along the lower border of the axes grid.
Example usage:
>>> axis.ticks.show_on_border_min = True
Type: bool
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.auto_spacing = False 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, supersample=3)
Attributes
alignment
Angle at which to render the label text. 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.
alignment
¶ Angle at which to render the label text.
Possible values:
LabelAlignment.ByAngle
,LabelAlignment.AlongAxis
orLabelAlignment.PerpendicularToAxis
.Example usage:
>>> from tecplot.constant import LabelAlignment >>> axis.tick_labels.alignment = LabelAlignment.AlongAxis
Type: float
(degrees) orLabelAlignment
-
TickLabels2D.
angle
¶ Angle at which to render the label text.
The
alignment
attribute must be set toLabelAlignment.ByAngle
:>>> from tecplot.constant import LabelAlignment >>> axis.tick_labels.alignment = LabelAlignment.ByAngle >>> axis.tick_labels.angle = 30
Type: float
(degrees)
-
TickLabels2D.
color
¶ Color of the tick labels.
Example usage:
>>> from tecplot.constant import Color >>> axis.tick_labels.color = Color.Blue
Type: Color
-
TickLabels2D.
font
¶ Text style control including typeface and size.
Example usage:
>>> axis.tick_labels.font.typeface = 'Times'
Type: text.Font
-
TickLabels2D.
format
¶ Label format and style control.
Example usage:
>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
Type: LabelFormat
-
TickLabels2D.
offset
¶ Relative offset of the tick labels.
Positive values will be outside the grid area, negative values are inside the grid area:
>>> axis.tick_labels.offset = 5
Type: float
-
TickLabels2D.
show
¶ Draw labels for the major tick marks.
Example usage:
>>> axis.tick_labels.show = True
Type: bool
-
TickLabels2D.
show_at_axis_intersection
¶ Include the labels at the intersection of other axes.
Example usage:
>>> axis.tick_labels.show_at_axis_intersection = True
Type: bool
-
TickLabels2D.
show_on_border_max
¶ Draw labels along the upper grid area border.
Example usage:
>>> axis.tick_labels.show_on_border_max = True
Type: bool
-
TickLabels2D.
show_on_border_min
¶ Draw labels along the lower grid area border.
Example usage:
>>> axis.tick_labels.show_on_border_min = True
Type: bool
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, 'SimpleData', 'F18.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 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, supersample=3)
Attributes
alignment
Angle at which to render the label text. 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.
alignment
¶ Angle at which to render the label text.
Possible values:
LabelAlignment.ByAngle
,LabelAlignment.AlongAxis
orLabelAlignment.PerpendicularToAxis
.Example usage:
>>> from tecplot.constant import LabelAlignment >>> axis.tick_labels.alignment = LabelAlignment.AlongAxis
Type: float
(degrees) orLabelAlignment
-
TickLabels3D.
angle
¶ Angle at which to render the label text.
The
alignment
attribute must be set toLabelAlignment.ByAngle
:>>> from tecplot.constant import LabelAlignment >>> axis.tick_labels.alignment = LabelAlignment.ByAngle >>> axis.tick_labels.angle = 30
Type: float
(degrees)
-
TickLabels3D.
color
¶ Color of the tick labels.
Example usage:
>>> from tecplot.constant import Color >>> axis.tick_labels.color = Color.Blue
Type: Color
-
TickLabels3D.
font
¶ Text style control including typeface and size.
Example usage:
>>> axis.tick_labels.font.typeface = 'Times'
Type: text.Font
-
TickLabels3D.
format
¶ Label format and style control.
Example usage:
>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
Type: LabelFormat
-
TickLabels3D.
offset
¶ Relative offset of the tick labels.
Positive values will be outside the grid area, negative values are inside the grid area:
>>> axis.tick_labels.offset = 5
Type: float
-
TickLabels3D.
show
¶ Draw labels for the major tick marks.
Example usage:
>>> axis.tick_labels.show = True
Type: bool
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 examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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, supersample=3)
Attributes
alignment
Angle at which to render the label text. 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.
alignment
¶ Angle at which to render the label text.
Possible values:
LabelAlignment.ByAngle
,LabelAlignment.AlongAxis
orLabelAlignment.PerpendicularToAxis
.Example usage:
>>> from tecplot.constant import LabelAlignment >>> axis.tick_labels.alignment = LabelAlignment.AlongAxis
Type: float
(degrees) orLabelAlignment
-
RadialTickLabels.
angle
¶ Angle at which to render the label text.
The
alignment
attribute must be set toLabelAlignment.ByAngle
:>>> from tecplot.constant import LabelAlignment >>> axis.tick_labels.alignment = LabelAlignment.ByAngle >>> axis.tick_labels.angle = 30
Type: float
(degrees)
-
RadialTickLabels.
color
¶ Color of the tick labels.
Example usage:
>>> from tecplot.constant import Color >>> axis.tick_labels.color = Color.Blue
Type: Color
-
RadialTickLabels.
font
¶ Text style control including typeface and size.
Example usage:
>>> axis.tick_labels.font.typeface = 'Times'
Type: text.Font
-
RadialTickLabels.
format
¶ Label format and style control.
Example usage:
>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
Type: LabelFormat
-
RadialTickLabels.
offset
¶ Relative offset of the tick labels.
Positive values will be outside the grid area, negative values are inside the grid area:
>>> axis.tick_labels.offset = 5
Type: float
-
RadialTickLabels.
show
¶ Draw labels for the major tick marks.
Example usage:
>>> axis.tick_labels.show = True
Type: bool
-
RadialTickLabels.
show_at_axis_intersection
¶ Include the labels at the intersection of other axes.
Example usage:
>>> axis.tick_labels.show_at_axis_intersection = True
Type: bool
-
RadialTickLabels.
show_on_all_radial_axes
¶ Draw labels along all radial axis lines.
Example usage:
>>> plot.axes.r_axis.line.show_perpendicular = True >>> plot.axes.r_axis.tick_labels.show_on_all_radial_axes = True
Type: bool
-
RadialTickLabels.
show_on_border_max
¶ Draw labels along the upper grid area border.
Example usage:
>>> axis.tick_labels.show_on_border_max = True
Type: bool
-
RadialTickLabels.
show_on_border_min
¶ Draw labels along the lower grid area border.
Example usage:
>>> axis.tick_labels.show_on_border_min = True
Type: bool
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, supersample=3)
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.
Example usage:
>>> from tecplot.constant import Color >>> axis.title.color = Color.Blue
Type: Color
-
Axis2DTitle.
font
¶ Typeface and size of the text.
Example usage:
>>> axis.title.font.size = 5
Type: text.Font
-
Axis2DTitle.
offset
¶ Transverse offset of the title from the axis.
Positive values are outside the axes, negative numbers are inside the axes. Example usage:
>>> axis.title.offset = 5
Type: float
in percent of frame height.
-
Axis2DTitle.
position
¶ Percent along axis line to place title.
Example usage:
>>> axis.title.position = 50
Type: float
-
Axis2DTitle.
show_on_border_max
¶ Draw title along the upper grid area border.
Example usage:
>>> axis.title.show_on_border_max = True
Type: bool
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, AxisTitleMode examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'F18.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.title_mode = AxisTitleMode.UseText 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.title_mode = AxisTitleMode.UseText 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, supersample=3)
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. title_mode
Define the source for the axis title.
-
DataAxis2DTitle.
color
¶ Text color of axis title.
Example usage:
>>> from tecplot.constant import Color >>> axis.title.color = Color.Blue
Type: Color
-
DataAxis2DTitle.
font
¶ Typeface and size of the text.
Example usage:
>>> axis.title.font.size = 5
Type: text.Font
-
DataAxis2DTitle.
offset
¶ Transverse offset of the title from the axis.
Positive values are outside the axes, negative numbers are inside the axes. Example usage:
>>> axis.title.offset = 5
Type: float
in percent of frame height.
-
DataAxis2DTitle.
position
¶ Percent along axis line to place title.
Example usage:
>>> axis.title.position = 50
Type: float
-
DataAxis2DTitle.
show
¶ Place title along the axis.
Example usage:
>>> axis.title.show = False
Type: bool
-
DataAxis2DTitle.
show_on_border_max
¶ Draw title along the upper grid area border.
Example usage:
>>> axis.title.show_on_border_max = True
Type: bool
-
DataAxis2DTitle.
show_on_border_min
¶ Draw title along the lower grid area border.
Example usage:
>>> axis.title.show_on_border_min = True
Type: bool
-
DataAxis2DTitle.
text
¶ The text of the title for this axis.
The
title_mode
attribute must be set toAxisTitleMode.UseText
:>>> from tecplot.constant import AxisTitleMode >>> axis.title.title_mode = AxisTitleMode.UseText >>> axis.title.text = 'distance (m)'
Type: str
-
DataAxis2DTitle.
title_mode
¶ Define the source for the axis title.
Possible values:
AxisTitleMode.UseText
orAxisTitleMode.UseVarName
.Example usage:
>>> from tecplot.constant import AxisTitleMode >>> axis.title.title_mode = AxisTitleMode.UseVarName
Type: AxisTitleMode
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, AxisTitleMode examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'F18.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.title_mode = AxisTitleMode.UseText xaxis.title.text = 'Longitudinal (m)' xaxis.title.color = Color.BluePurple xaxis.title.position = 10 yaxis = plot.axes.y_axis yaxis.show = True yaxis.title.title_mode = AxisTitleMode.UseText yaxis.title.text = 'Transverse (m)' yaxis.title.color = Color.BluePurple yaxis.title.position = 90 zaxis = plot.axes.z_axis zaxis.show = True zaxis.title.title_mode = AxisTitleMode.UseText 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, supersample=3)
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. title_mode
Define the source for the axis title.
-
DataAxis3DTitle.
color
¶ Text color of axis title.
Example usage:
>>> from tecplot.constant import Color >>> axis.title.color = Color.Blue
Type: Color
-
DataAxis3DTitle.
font
¶ Typeface and size of the text.
Example usage:
>>> axis.title.font.size = 5
Type: text.Font
-
DataAxis3DTitle.
offset
¶ Transverse offset of the title from the axis.
Positive values are outside the axes, negative numbers are inside the axes. Example usage:
>>> axis.title.offset = 5
Type: float
in percent of frame height.
-
DataAxis3DTitle.
position
¶ Percent along axis line to place title.
Example usage:
>>> axis.title.position = 50
Type: float
-
DataAxis3DTitle.
show
¶ Place title along the axis.
Example usage:
>>> axis.title.show = False
Type: bool
-
DataAxis3DTitle.
show_on_opposite_edge
¶ Draw the title on the opposite edge of the grid.
Example usage:
>>> axis.title.show_on_opposite_edge = True
Type: bool
-
DataAxis3DTitle.
text
¶ The text of the title for this axis.
The
title_mode
attribute must be set toAxisTitleMode.UseText
:>>> from tecplot.constant import AxisTitleMode >>> axis.title.title_mode = AxisTitleMode.UseText >>> axis.title.text = 'distance (m)'
Type: str
-
DataAxis3DTitle.
title_mode
¶ Define the source for the axis title.
Possible values:
AxisTitleMode.UseText
orAxisTitleMode.UseVarName
.Example usage:
>>> from tecplot.constant import AxisTitleMode >>> axis.title.title_mode = AxisTitleMode.UseVarName
Type: AxisTitleMode
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, AxisTitleMode 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.values('R')[:] = r zone.values('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.title_mode = AxisTitleMode.UseText 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, supersample=3)
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. title_mode
Define the source for the axis title.
-
RadialAxisTitle.
color
¶ Text color of axis title.
Example usage:
>>> from tecplot.constant import Color >>> axis.title.color = Color.Blue
Type: Color
-
RadialAxisTitle.
font
¶ Typeface and size of the text.
Example usage:
>>> axis.title.font.size = 5
Type: text.Font
-
RadialAxisTitle.
offset
¶ Transverse offset of the title from the axis.
Positive values are outside the axes, negative numbers are inside the axes. Example usage:
>>> axis.title.offset = 5
Type: float
in percent of frame height.
-
RadialAxisTitle.
position
¶ Percent along axis line to place title.
Example usage:
>>> axis.title.position = 50
Type: float
-
RadialAxisTitle.
show
¶ Place title along the axis.
Example usage:
>>> axis.title.show = False
Type: bool
-
RadialAxisTitle.
show_on_all_radial_axes
¶ Draw title along all radial axis lines.
Example usage:
>>> plot.axes.r_axis.line.show_perpendicular = True >>> plot.axes.r_axis.title.show_on_all_radial_axes = True
Type: bool
-
RadialAxisTitle.
show_on_border_max
¶ Draw title along the upper grid area border.
Example usage:
>>> axis.title.show_on_border_max = True
Type: bool
-
RadialAxisTitle.
show_on_border_min
¶ Draw title along the lower grid area border.
Example usage:
>>> axis.title.show_on_border_min = True
Type: bool
-
RadialAxisTitle.
text
¶ The text of the title for this axis.
The
title_mode
attribute must be set toAxisTitleMode.UseText
:>>> from tecplot.constant import AxisTitleMode >>> axis.title.title_mode = AxisTitleMode.UseText >>> axis.title.text = 'distance (m)'
Type: str
-
RadialAxisTitle.
title_mode
¶ Define the source for the axis title.
Possible values:
AxisTitleMode.UseText
orAxisTitleMode.UseVarName
.Example usage:
>>> from tecplot.constant import AxisTitleMode >>> axis.title.title_mode = AxisTitleMode.UseVarName
Type: AxisTitleMode
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 examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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.filled = True grid_area.fill_color = Color.SkyBlue grid_area.show_border = True tp.export.save_png('grid_area_polar.png', 600, supersample=3)
Attributes
fill_color
Axes area background color. filled
Fill the axes area background color. show_border
Draw border around axes area.
-
GridArea.
fill_color
¶ Axes area background color.
This requires the
filled
attribute to beTrue
:>>> from tecplot.constant import Color >>> plot.axes.grid_area.filled = True >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: Color
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, 'SimpleData', 'SunSpots.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.filled = True grid_area.fill_color = Color.SkyBlue grid_area.show_border = True tp.export.save_png('grid_area_2d.png', 600, supersample=3)
Attributes
border_color
Border line color. border_thickness
Width of the border lines to be drawn. fill_color
Axes area background color. filled
Fill the axes area background color. show_border
Draw border around axes area.
-
Cartesian2DGridArea.
border_color
¶ Border line color.
Example usage:
>>> from tecplot.constant import Color >>> plot.axes.grid_area.show_border = True >>> plot.axes.grid_area.border_color = Color.LightGreen
Type: Color
-
Cartesian2DGridArea.
border_thickness
¶ Width of the border lines to be drawn.
Example usage:
>>> plot.axes.grid_area.border_thickness = 0.5
Type: float
-
Cartesian2DGridArea.
fill_color
¶ Axes area background color.
This requires the
filled
attribute to beTrue
:>>> from tecplot.constant import Color >>> plot.axes.grid_area.filled = True >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: Color
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, 'SimpleData', 'Pyramid.plt') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() plot = frame.plot(PlotType.Cartesian3D) fmaps = plot.fieldmaps() fmaps.contour.show = True fmaps.surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces plot.show_contour = True plot.contour(0).legend.show = False 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.use_lighting_effect = True plot.view.fit() tp.export.save_png('grid_area_3d.png', 600, supersample=3)
Attributes
fill_color
Axes area background color. filled
Fill the axes area background color. show_border
Draw border around axes area. use_lighting_effect
Enable lighting effect shading on grid area.
-
Cartesian3DGridArea.
fill_color
¶ Axes area background color.
This requires the
filled
attribute to beTrue
:>>> from tecplot.constant import Color >>> plot.axes.grid_area.filled = True >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: Color
-
Cartesian3DGridArea.
filled
¶ Fill the axes area background color.
Example usage:
>>> from tecplot.constant import Color >>> plot.axes.grid_area.filled = True >>> plot.axes.grid_area.fill_color = Color.LightGreen
Type: bool
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 examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', '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.values(0).max() grid = plot.axes.precise_grid grid.show = True grid.size = 0.05 # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() tp.export.save_png('precise_grid.png', 600, supersample=3)
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.
Example usage:
>>> plot.axes.precise_grid.color = Color.DarkBlue
Type: Color
GridLines¶
-
class
tecplot.plot.
GridLines
(axis)[source]¶ Major grid lines.
from os import path import tecplot as tp from tecplot.constant import LinePattern, Color examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'Sphere.lpk') dataset = tp.load_layout(datafile) plot = tp.active_frame().plot() plot.axes.grid_area.fill_color = Color.Grey for axis in (plot.axes.x_axis, plot.axes.y_axis): axis.show = True grid_lines = axis.grid_lines grid_lines.show = True grid_lines.line_pattern = LinePattern.LongDash grid_lines.color = Color.Cyan plot.view.fit() tp.export.save_png('grid_lines.png', 600, supersample=3)
Attributes
color
Color
of the grid lines to be drawn.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.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
GridLines.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
GridLines.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
GridLines2D¶
-
class
tecplot.plot.
GridLines2D
(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:
from os import path import tecplot as tp from tecplot.constant import LinePattern, Color examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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_2d.png', 600, supersample=3)
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.
-
GridLines2D.
color
¶ Color
of the grid lines to be drawn.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
GridLines2D.
draw_last
¶ Draw grid behind all other plot elements.
Example usage:
>>> axis.grid_lines.draw_last = True
Type: bool
-
GridLines2D.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
GridLines2D.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
MinorGridLines¶
-
class
tecplot.plot.
MinorGridLines
(axis)[source]¶ Minor grid lines.
from os import path import tecplot as tp from tecplot.constant import LinePattern, Color examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'Sphere.lpk') dataset = tp.load_layout(datafile) plot = tp.active_frame().plot() plot.axes.grid_area.fill_color = Color.Grey for axis in (plot.axes.x_axis, plot.axes.y_axis): axis.show = True 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.Cyan plot.view.fit() tp.export.save_png('minor_grid_lines.png', 600, supersample=3)
Attributes
color
Color
of the grid lines to be drawn.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.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
MinorGridLines.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
MinorGridLines.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
MinorGridLines2D¶
-
class
tecplot.plot.
MinorGridLines2D
(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 examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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_2d.png', 600, supersample=3)
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.
-
MinorGridLines2D.
color
¶ Color
of the grid lines to be drawn.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
MinorGridLines2D.
draw_last
¶ Draw grid behind all other plot elements.
Example usage:
>>> axis.grid_lines.draw_last = True
Type: bool
-
MinorGridLines2D.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
MinorGridLines2D.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
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 examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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.filled = True 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, supersample=3)
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.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
PolarAngleGridLines.
draw_last
¶ Draw grid behind all other plot elements.
Example usage:
>>> axis.grid_lines.draw_last = True
Type: bool
-
PolarAngleGridLines.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
PolarAngleGridLines.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
-
PolarAngleGridLines.
pattern_length
¶ Segment length of the repeated line pattern.
Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash >>> grid_lines.pattern_length = 3.5
Type: float
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 examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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.filled = True 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, supersample=3)
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.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
PolarAngleMinorGridLines.
draw_last
¶ Draw grid behind all other plot elements.
Example usage:
>>> axis.grid_lines.draw_last = True
Type: bool
-
PolarAngleMinorGridLines.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
PolarAngleMinorGridLines.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
-
PolarAngleMinorGridLines.
pattern_length
¶ Segment length of the repeated line pattern.
Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash >>> grid_lines.pattern_length = 3.5
Type: float
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, PositionMarkerBy examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'Sphere.lpk') dataset = tp.load_layout(datafile) plot = tp.active_frame().plot(PlotType.Cartesian3D) plot.activate() plot.axes.grid_area.fill_color = Color.Grey plot.axes.x_axis.show = True plot.axes.y_axis.show = True marker = plot.axes.x_axis.marker_grid_line marker.show = True marker.position_by = PositionMarkerBy.Constant marker.position = 1.5 marker.color = Color.Cyan marker = plot.axes.y_axis.marker_grid_line marker.show = True marker.position_by = PositionMarkerBy.Constant marker.position = 0.5 marker.color = Color.Yellow plot.view.fit() tp.export.save_png('marker_grid_line.png', 600, supersample=3)
Attributes
color
Color
of the grid lines to be drawn.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. position_by
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.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
MarkerGridLine.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
MarkerGridLine.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
-
MarkerGridLine.
pattern_length
¶ Segment length of the repeated line pattern.
Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash >>> grid_lines.pattern_length = 3.5
Type: float
-
MarkerGridLine.
position
¶ Position of the marker line in axes coordinates.
The
position_by
attribute must be set toPositionMarkerBy.Constant
:>>> from tecplot.constant import PositionMarkerBy >>> marker_line = plot.axes.x_axis.marker_grid_line >>> marker_line.position_by = PositionMarkerBy.Constant >>> marker_line.position = 3.14
Type: float
-
MarkerGridLine.
position_by
¶ Position of the marker line in axes coordinates.
- Possible values:
PositionMarkerBy.Constant
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_by = PositionMarkerBy.SolutionTime
Type: PositionMarkerBy
- Possible values:
MarkerGridLine2D¶
-
class
tecplot.plot.
MarkerGridLine2D
(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, PositionMarkerBy examples_dir = tp.session.tecplot_examples_directory() datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.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_by = PositionMarkerBy.Constant marker.position = -0.4 marker.color = Color.Blue marker = plot.axes.y_axis(0).marker_grid_line marker.show = True marker.position_by = PositionMarkerBy.Constant marker.position = -0.88 marker.color = Color.Blue tp.export.save_png('marker_grid_line_2d.png', 600, supersample=3)
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. position_by
Position of the marker line in axes coordinates. show
Draw grid lines as tick locations.
-
MarkerGridLine2D.
color
¶ Color
of the grid lines to be drawn.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
MarkerGridLine2D.
draw_last
¶ Draw grid behind all other plot elements.
Example usage:
>>> axis.grid_lines.draw_last = True
Type: bool
-
MarkerGridLine2D.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
MarkerGridLine2D.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
-
MarkerGridLine2D.
pattern_length
¶ Segment length of the repeated line pattern.
Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash >>> grid_lines.pattern_length = 3.5
Type: float
-
MarkerGridLine2D.
position
¶ Position of the marker line in axes coordinates.
The
position_by
attribute must be set toPositionMarkerBy.Constant
:>>> from tecplot.constant import PositionMarkerBy >>> marker_line = plot.axes.x_axis.marker_grid_line >>> marker_line.position_by = PositionMarkerBy.Constant >>> marker_line.position = 3.14
Type: float
-
MarkerGridLine2D.
position_by
¶ Position of the marker line in axes coordinates.
- Possible values:
PositionMarkerBy.Constant
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_by = PositionMarkerBy.SolutionTime
Type: PositionMarkerBy
- Possible values:
PolarAngleMarkerGridLine¶
-
class
tecplot.plot.
PolarAngleMarkerGridLine
(axis)[source]¶ The marker grid line for the theta axis.
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. position_by
Position of the marker line in axes coordinates. radial_cutoff
Minimum radial position of theta grid lines. show
Draw grid lines as tick locations.
-
PolarAngleMarkerGridLine.
color
¶ Color
of the grid lines to be drawn.Example usage:
>>> from tecplot.constant import Color >>> grid_lines.color = Color.Blue
Type: Color
-
PolarAngleMarkerGridLine.
draw_last
¶ Draw grid behind all other plot elements.
Example usage:
>>> axis.grid_lines.draw_last = True
Type: bool
-
PolarAngleMarkerGridLine.
line_pattern
¶ Pattern style of the grid lines to be drawn.
Possible values:
Solid
,Dashed
,DashDot
,Dotted
,LongDash
,DashDotDot
.Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash
Type: LinePattern
-
PolarAngleMarkerGridLine.
line_thickness
¶ Width of the grid lines to be drawn.
Example usage:
>>> grid_lines.line_thickness = 0.5
Type: float
-
PolarAngleMarkerGridLine.
pattern_length
¶ Segment length of the repeated line pattern.
Example usage:
>>> from tecplot.constant import LinePattern >>> grid_lines.line_pattern = LinePattern.LongDash >>> grid_lines.pattern_length = 3.5
Type: float
-
PolarAngleMarkerGridLine.
position
¶ Position of the marker line in axes coordinates.
The
position_by
attribute must be set toPositionMarkerBy.Constant
:>>> from tecplot.constant import PositionMarkerBy >>> marker_line = plot.axes.x_axis.marker_grid_line >>> marker_line.position_by = PositionMarkerBy.Constant >>> marker_line.position = 3.14
Type: float
-
PolarAngleMarkerGridLine.
position_by
¶ Position of the marker line in axes coordinates.
- Possible values:
PositionMarkerBy.Constant
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_by = PositionMarkerBy.SolutionTime
Type: PositionMarkerBy
- Possible values:
OrientationAxis¶
-
class
tecplot.plot.
OrientationAxis
(axes)[source]¶ The orientation axis for 3D Field plots.
This is the small (x, y, z) reference axis object which can moved, resized and modified using this class.
By default, all 3D plots show the 3D orientation axis in the upper right of the frame. It can be repositioned by setting
position
as shown below:from os import path import tecplot as tp from tecplot.constant import Color examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Sphere.lpk') dataset = tp.load_layout(infile) frame = tp.active_frame() plot = frame.plot() plot.axes.orientation_axis.position = 15, 15 plot.axes.orientation_axis.color = Color.BrightCyan plot.axes.reset_range() plot.view.fit() tp.export.save_png('axes_orientation.png', 600, supersample=3)
Attributes
color
Color
of the orientation axes.line_thickness
Line thickness used when drawing the orientation axis as a percentage of frame height. position
(x, y)
position of the orientation axis.show
Enable drawing of the orientation axis. show_variable_name
Use variable names instead of ‘X’, ‘Y’ and ‘Z’. size
Size of the orientation axis as a percentage of frame size (0-100).
-
OrientationAxis.
color
¶ Color
of the orientation axes.Example usage:
>>> from tecplot.constant import Color >>> plot.axes.orientation_axis.color = Color.Cyan
Type: Color
-
OrientationAxis.
line_thickness
¶ Line thickness used when drawing the orientation axis as a percentage of frame height.
Example usage:
>>> plot.axes.orientation_axis.line_thickness = 0.8
Type: float
-
OrientationAxis.
position
¶ (x, y)
position of the orientation axis.The position is in percent from the lower-left corner of the viewport:
>>> plot.axes.orientation_axis.position = (15, 15)
Type: tuple
-
OrientationAxis.
show
¶ Enable drawing of the orientation axis.
Example usage:
>>> plot.axes.orientation_axis.show = False
Type: bool