Plot¶
Plots¶
Cartesian2DFieldPlot¶
-
class
tecplot.plot.Cartesian2DFieldPlot(frame)[source]¶ 2D plot containing field data associated with style through fieldmaps.
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.activate() plot.vector.u_variable = dataset.variable('U(M/S)') plot.vector.v_variable = dataset.variable('V(M/S)') plot.contour(2).variable = dataset.variable('T(K)') plot.contour(2).colormap_name = 'Sequential - Yellow/Green/Blue' for z in dataset.zones(): fmap = plot.fieldmap(z) fmap.contour.flood_contour_group = plot.contour(2) plot.show_contour = True plot.show_vector = True # ensure consistent output between interactive (connected) and batch plot.contour(2).levels.reset_to_nice() # save image to file tp.export.save_png('plot_field2d.png', 600, supersample=3)
Attributes
active_fieldmap_indicesSet of active fieldmaps by index. active_fieldmapsActive fieldmaps in this plot. axesAxes style control for this plot. data_labelsNode and cell labels. draw_orderThe order in which objects are drawn to the screen. ijk_blankingMask off cells by \((i, j, k)\) index. linking_between_framesStyle linking between frames. num_fieldmapsNumber of all fieldmaps in this plot. num_solution_timesNumber of solution times for all active fieldmaps. rgb_coloringRGB contour flooding style control. scatterPlot-local Scatterstyle control.show_contourEnable contours for this plot. show_edgeEnable zone edge lines for this plot. show_isosurfacesShow isosurfaces for this plot. show_meshEnable mesh lines for this plot. show_scatterEnable scatter symbols for this plot. show_shadeEnable surface shading effect for this plot. show_slicesShow slices for this plot. show_streamtracesEnable drawing Streamtraceson this plot.show_vectorEnable drawing of vectors. solution_timeThe current solution time. solution_timesListof active solution times.solution_timestepThe zero-based index of the current solution time. streamtracesPlot-local streamtraceattributes.value_blankingMask off cells by value. vectorVector variable and style control for this plot. viewAxes orientation and limits adjustments. Methods
activate()Make this the active plot type on the parent frame. activated()Context to ensure this plot is active. contour(index)ContourGroup: Plot-localContourGroupstyle control.fieldmap(key)Returns a Cartesian2DFieldmapby Zone or index.fieldmap_index(zone)The index of the fieldmap associated with a Zone. fieldmaps()All fieldmaps in this plot.
-
Cartesian2DFieldPlot.activate()[source]¶ Make this the active plot type on the parent frame.
Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.Cartesian2D) >>> plot.activate()
-
Cartesian2DFieldPlot.activated()¶ Context to ensure this plot is active.
Example usage:
>>> from tecplot.constant import PlotType >>> frame = tecplot.active_frame() >>> frame.plot_type = PlotType.XYLine # set active plot type >>> plot = frame.plot(PlotType.Cartesian3D) # get inactive plot >>> print(frame.plot_type) PlotType.XYLine >>> with plot.activated(): ... print(frame.plot_type) # 3D plot temporarily active PlotType.Cartesian3D >>> print(frame.plot_type) # original plot type restored PlotType.XYLine
-
Cartesian2DFieldPlot.active_fieldmap_indices¶ Set of active fieldmaps by index.
This example sets the first three fieldmaps active, disabling all others. It then turns on scatter symbols for just these three:
>>> plot.active_fieldmap_indices = [0, 1, 2] >>> for i in plot.active_fieldmap_indices: ... plot.fieldmap(i).scatter.show = True
Type: set
-
Cartesian2DFieldPlot.active_fieldmaps¶ Active fieldmaps in this plot.
Returns: Cartesian2DFieldmaporCartesian3DFieldmapExample usage:
>>> for fmap in plot.active_fieldmaps: ... fmap.vector.show = True
Note
Possible side-effect when connected to Tecplot 360.
Changing the solution times in the dataset or modifying the active fieldmaps in a frame may trigger a change in the active plot’s solution time by the Tecplot 360 interface. This is done to keep the GUI controls consistent. In batch mode, no such side-effect will take place and the user must take care to set the plot’s solution time with the
plot.solution_timeorplot.solution_timestepproperties.
-
Cartesian2DFieldPlot.axes¶ Axes style control for this plot.
Example usage:
>>> from tecplot.constant import PlotType >>> frame.plot_type = PlotType.Cartesian2D >>> axes = frame.plot().axes >>> axes.x_axis.variable = dataset.variable('U') >>> axes.y_axis.variable = dataset.variable('V')
Type: Cartesian2DFieldAxes
-
Cartesian2DFieldPlot.contour(index)¶ ContourGroup: Plot-localContourGroupstyle control.Example usage:
>>> contour = frame.plot().contour(0) >>> contour.colormap_name = 'Magma'
-
Cartesian2DFieldPlot.data_labels¶ Node and cell labels.
This object controls displaying labels for every node and/or cell in the dataset. Example usage:
>>> plot.data_labels.show_cell_labels = True >>> plot.data_labels.step_index = 10
Type: FieldPlotDataLabels
-
Cartesian2DFieldPlot.draw_order¶ The order in which objects are drawn to the screen.
Possible values:
TwoDDrawOrder.ByZone,TwoDDrawOrder.ByLayer.The order is either by Zone or by visual layer (contour, mesh, etc.):
>>> plot.draw_order = TwoDDrawOrder.ByZone
Type: TwoDDrawOrder
-
Cartesian2DFieldPlot.fieldmap(key)[source]¶ Returns a
Cartesian2DFieldmapby Zone or index.Parameters: key (Zone or int) – The Zone must be in theDatasetattached to the assocated frame of this plot. A negative index is interpreted as counting from the end of the available fieldmaps.Example usage:
>>> fmap = plot.fieldmap(dataset.zone(0)) >>> fmap.scatter.show = True
-
Cartesian2DFieldPlot.fieldmap_index(zone)¶ The index of the fieldmap associated with a Zone.
Parameters: zone (Zone) – The Zone object that belongs to the Datasetassociated with this plot.Returns: IndexExample usage:
>>> fmap_index = plot.fieldmap_index(dataset.zone('Zone')) >>> plot.fieldmap(fmap_index).show_mesh = True
-
Cartesian2DFieldPlot.fieldmaps()¶ All fieldmaps in this plot.
Returns: Iterator of Cartesian2DFieldmaporCartesian3DFieldmapExample usage:
>>> for fmap in plot.fieldmaps(): ... fmap.mesh.show = True
Changed in version 0.9:
fieldmapswas changed from a property (0.8 and earlier) to a method requiring parentheses.
-
Cartesian2DFieldPlot.ijk_blanking¶ Mask off cells by \((i, j, k)\) index.
Example usage:
>>> plot.ijk_blanking.min_percent = (50, 50) >>> plot.ijk_blanking.active = True
Type: IJKBlanking
-
Cartesian2DFieldPlot.linking_between_frames¶ Style linking between frames.
Example usage:
>>> plot.linking_between_frames.group = 1 >>> plot.linking_between_frames.link_solution_time = True
Type: Cartesian2DPlotLinkingBetweenFrames
-
Cartesian2DFieldPlot.num_fieldmaps¶ Number of all fieldmaps in this plot.
Example usage:
>>> print(frame.plot().num_fieldmaps) 3
Type: int
-
Cartesian2DFieldPlot.num_solution_times¶ Number of solution times for all active fieldmaps.
Note
This only returns the number of active solution times. When assigning strands and solution times to zones, the zones are placed into an inactive fieldmap that must be subsequently activated. See example below.
>>> # place all zones into a single fieldmap (strand: 1) >>> # with incrementing solution times >>> for time, zone in enumerate(dataset.zones()): ... zone.strand = 1 ... zone.solution_time = time ... >>> # We must activate the fieldmap to ensure the plot's >>> # solution times have been updated. Since we placed >>> # all zones into a single fieldmap, we can assume the >>> # first fieldmap (index: 0) is the one we want. >>> plot.active_fieldmaps += [0] >>> >>> # now the plot's solution times are available. >>> print(plot.num_solution_times) 10 >>> print(plot.solution_times) [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: int
-
Cartesian2DFieldPlot.rgb_coloring¶ RGB contour flooding style control.
Example usage:
>>> plot.rgb_coloring.red_variable = dataset.variable('gas') >>> plot.rgb_coloring.green_variable = dataset.variable('oil') >>> plot.rgb_coloring.blue_variable = dataset.variable('water') >>> plot.show_contour = True >>> for fmap in plot.fieldmaps(): ... fmap.contour.flood_contour_group = plot.rgb_coloring
Type: RGBColoring
-
Cartesian2DFieldPlot.scatter¶ Plot-local
Scatterstyle control.Example usage:
>>> scatter = frame.plot().scatter >>> scatter.variable = dataset.variable('P')
Type: Scatter
-
Cartesian2DFieldPlot.show_contour¶ Enable contours for this plot.
Example usage:
>>> frame.plot().show_contour = True
Type: bool
-
Cartesian2DFieldPlot.show_edge¶ Enable zone edge lines for this plot.
Example usage:
>>> frame.plot().show_edge = True
Type: bool
-
Cartesian2DFieldPlot.show_isosurfaces¶ Show isosurfaces for this plot.
- Example usage::
- >>>frame.plot().show_isosurfaces(True)
Type: bool
-
Cartesian2DFieldPlot.show_mesh¶ Enable mesh lines for this plot.
Example usage:
>>> frame.plot().show_mesh = True
Type: bool
-
Cartesian2DFieldPlot.show_scatter¶ Enable scatter symbols for this plot.
Example usage:
>>> frame.plot().show_scatter = True
Type: bool
-
Cartesian2DFieldPlot.show_shade¶ Enable surface shading effect for this plot.
Example usage:
>>> frame.plot().show_shade = True
Type: bool
-
Cartesian2DFieldPlot.show_slices¶ Show slices for this plot.
- Example usage::
- >>>frame.plot().show_slices(True)
Type: bool
-
Cartesian2DFieldPlot.show_streamtraces¶ Enable drawing
Streamtraceson this plot.Example usage:
>>> frame.plot().show_streamtraces = True
Type: bool
-
Cartesian2DFieldPlot.show_vector¶ Enable drawing of vectors.
Example usage:
>>> frame.plot().show_vector = True
Type: bool
-
Cartesian2DFieldPlot.solution_time¶ The current solution time.
Example usage:
>>> print(plot.solution_times) [0.0, 1.0, 2.0] >>> plot.solution_time = 1.0
Note
Possible side-effect when connected to Tecplot 360.
Changing the solution times in the dataset or modifying the active fieldmaps in a frame may trigger a change in the active plot’s solution time by the Tecplot 360 interface. This is done to keep the GUI controls consistent. In batch mode, no such side-effect will take place and the user must take care to set the plot’s solution time with the
plot.solution_timeorplot.solution_timestepproperties.New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: float
-
Cartesian2DFieldPlot.solution_times¶ Listof active solution times.Note
This only returns the list of active solution times. When assigning strands and solution times to zones, the zones are placed into an inactive fieldmap that must be subsequently activated. See example below.
Example usage:
>>> print(plot.solution_times) [0.0, 1.0, 2.0]
New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: listoffloats
-
Cartesian2DFieldPlot.solution_timestep¶ The zero-based index of the current solution time.
A negative index is interpreted as counting from the end of the available solution timesteps. Example usage:
>>> print(plot.solution_times) [0.0, 1.0, 2.0] >>> print(plot.solution_time) 0.0 >>> plot.solution_timestep += 1 >>> print(plot.solution_time) 1.0
Note
Possible side-effect when connected to Tecplot 360.
Changing the solution times in the dataset or modifying the active fieldmaps in a frame may trigger a change in the active plot’s solution time by the Tecplot 360 interface. This is done to keep the GUI controls consistent. In batch mode, no such side-effect will take place and the user must take care to set the plot’s solution time with the
plot.solution_timeorplot.solution_timestepproperties.New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: int
-
Cartesian2DFieldPlot.streamtraces¶ Plot-local
streamtraceattributes.Example usage:
>>> streamtraces = frame.plot().streamtraces >>> streamtraces.color = Color.Blue
Type: Streamtraces
-
Cartesian2DFieldPlot.value_blanking¶ Mask off cells by value.
Example usage:
>>> plot.value_blanking.constraint(0).comparison_value = 3.14 >>> plot.value_blanking.constraint(0).active = True
Type: ValueBlanking
-
Cartesian2DFieldPlot.vector¶ Vector variable and style control for this plot.
Example usage:
>>> plot.vector.u_variable = dataset.variable('U')
Type: Vector2D
-
Cartesian2DFieldPlot.view¶ Axes orientation and limits adjustments.
Example usage:
>>> plot.view.fit()
Type: Cartesian2DFieldView
Cartesian3DFieldPlot¶
-
class
tecplot.plot.Cartesian3DFieldPlot(frame)[source]¶ 3D plot containing field data associated with style through fieldmaps.
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', 'SpaceShip.lpk') dataset = tp.load_layout(infile) frame = tp.active_frame() plot = frame.plot(PlotType.Cartesian3D) plot.activate() plot.use_lighting_effect = False plot.show_streamtraces = False plot.use_translucency = True # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() # save image to file tp.export.save_png('plot_field3d.png', 600, supersample=3)
Attributes
active_fieldmap_indicesSet of active fieldmaps by index. active_fieldmapsActive fieldmaps in this plot. axesAxes style control for this plot. data_labelsNode and cell labels. ijk_blankingMask off cells by \((i, j, k)\) index. light_sourceControl the direction and effects of lighting. line_lift_fractionLift lines above plot by percentage distance to the eye. linking_between_framesStyle linking between frames. near_plane_fractionposition of the “near plane”. num_fieldmapsNumber of all fieldmaps in this plot. num_solution_timesNumber of solution times for all active fieldmaps. perform_extra_sortingUse a more robust depth sorting algorithm for display. rgb_coloringRGB contour flooding style control. scatterPlot-local Scatterstyle control.show_contourEnable contours for this plot. show_edgeEnable zone edge lines for this plot. show_isosurfacesShow isosurfaces for this plot. show_meshEnable mesh lines for this plot. show_scatterEnable scatter symbols for this plot. show_shadeEnable surface shading effect for this plot. show_slicesShow slices for this plot. show_streamtracesEnable drawing Streamtraceson this plot.show_vectorEnable drawing of vectors. solution_timeThe current solution time. solution_timesListof active solution times.solution_timestepThe zero-based index of the current solution time. streamtracesPlot-local streamtraceattributes.symbol_lift_fractionLift symbols above plot by percentage distance to the eye. use_lighting_effectEnable lighting effect for all objects within this plot. use_translucencyEnable translucent effect for all objects within this plot. value_blankingMask off cells by value. vectorVector variable and style control for this plot. vector_lift_fractionLift vectors above plot by percentage distance to the eye. viewViewport, axes orientation and limits adjustments. Methods
activate()Make this the active plot type on the parent frame. activated()Context to ensure this plot is active. contour(index)ContourGroup: Plot-localContourGroupstyle control.fieldmap(key)Returns a Cartesian3DFieldmapby Zone or index.fieldmap_index(zone)The index of the fieldmap associated with a Zone. fieldmaps()All fieldmaps in this plot. isosurface(index)IsosurfaceGroup: Plot-localisosurfacesettings.slice(index)SliceGroup: Plot-localslicestyle control.
-
Cartesian3DFieldPlot.activate()[source]¶ Make this the active plot type on the parent frame.
Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.Cartesian3D) >>> plot.activate()
-
Cartesian3DFieldPlot.activated()¶ Context to ensure this plot is active.
Example usage:
>>> from tecplot.constant import PlotType >>> frame = tecplot.active_frame() >>> frame.plot_type = PlotType.XYLine # set active plot type >>> plot = frame.plot(PlotType.Cartesian3D) # get inactive plot >>> print(frame.plot_type) PlotType.XYLine >>> with plot.activated(): ... print(frame.plot_type) # 3D plot temporarily active PlotType.Cartesian3D >>> print(frame.plot_type) # original plot type restored PlotType.XYLine
-
Cartesian3DFieldPlot.active_fieldmap_indices¶ Set of active fieldmaps by index.
This example sets the first three fieldmaps active, disabling all others. It then turns on scatter symbols for just these three:
>>> plot.active_fieldmap_indices = [0, 1, 2] >>> for i in plot.active_fieldmap_indices: ... plot.fieldmap(i).scatter.show = True
Type: set
-
Cartesian3DFieldPlot.active_fieldmaps¶ Active fieldmaps in this plot.
Returns: Cartesian2DFieldmaporCartesian3DFieldmapExample usage:
>>> for fmap in plot.active_fieldmaps: ... fmap.vector.show = True
Note
Possible side-effect when connected to Tecplot 360.
Changing the solution times in the dataset or modifying the active fieldmaps in a frame may trigger a change in the active plot’s solution time by the Tecplot 360 interface. This is done to keep the GUI controls consistent. In batch mode, no such side-effect will take place and the user must take care to set the plot’s solution time with the
plot.solution_timeorplot.solution_timestepproperties.
-
Cartesian3DFieldPlot.axes¶ Axes style control for this plot.
Example usage:
>>> from tecplot.constant import PlotType >>> frame.plot_type = PlotType.Cartesian3D >>> axes = frame.plot().axes >>> axes.x_axis.variable = dataset.variable('U') >>> axes.y_axis.variable = dataset.variable('V') >>> axes.z_axis.variable = dataset.variable('W')
Type: Cartesian3DFieldAxes
-
Cartesian3DFieldPlot.contour(index)¶ ContourGroup: Plot-localContourGroupstyle control.Example usage:
>>> contour = frame.plot().contour(0) >>> contour.colormap_name = 'Magma'
-
Cartesian3DFieldPlot.data_labels¶ Node and cell labels.
This object controls displaying labels for every node and/or cell in the dataset. Example usage:
>>> plot.data_labels.show_cell_labels = True >>> plot.data_labels.step_index = 10
Type: FieldPlotDataLabels
-
Cartesian3DFieldPlot.fieldmap(key)[source]¶ Returns a
Cartesian3DFieldmapby Zone or index.Parameters: key (Zone or int) – The Zone must be in theDatasetattached to the assocated frame of this plot. A negative index is interpreted as counting from the end of the available fieldmaps.Example usage:
>>> fmap = plot.fieldmap(dataset.zone(0)) >>> fmap.scatter.show = True
-
Cartesian3DFieldPlot.fieldmap_index(zone)¶ The index of the fieldmap associated with a Zone.
Parameters: zone (Zone) – The Zone object that belongs to the Datasetassociated with this plot.Returns: IndexExample usage:
>>> fmap_index = plot.fieldmap_index(dataset.zone('Zone')) >>> plot.fieldmap(fmap_index).show_mesh = True
-
Cartesian3DFieldPlot.fieldmaps()¶ All fieldmaps in this plot.
Returns: Iterator of Cartesian2DFieldmaporCartesian3DFieldmapExample usage:
>>> for fmap in plot.fieldmaps(): ... fmap.mesh.show = True
Changed in version 0.9:
fieldmapswas changed from a property (0.8 and earlier) to a method requiring parentheses.
-
Cartesian3DFieldPlot.ijk_blanking¶ Mask off cells by \((i, j, k)\) index.
Example usage:
>>> plot.ijk_blanking.min_percent = (50, 50) >>> plot.ijk_blanking.active = True
Type: IJKBlanking
-
Cartesian3DFieldPlot.isosurface(index)[source]¶ IsosurfaceGroup: Plot-localisosurfacesettings.Example usage:
>>> isosurface_0 = frame.plot().isosurface(0) >>> isosurface_0.mesh.color = Color.Blue
-
Cartesian3DFieldPlot.light_source¶ Control the direction and effects of lighting.
Example usage:
>>> plot.light_source.intensity = 70.0
Type: LightSource
-
Cartesian3DFieldPlot.line_lift_fraction¶ Lift lines above plot by percentage distance to the eye.
Example usage:
>>> plot.line_lift_fraction = 0.6
Type: float
-
Cartesian3DFieldPlot.linking_between_frames¶ Style linking between frames.
Example usage:
>>> plot.linking_between_frames.group = 1 >>> plot.linking_between_frames.link_solution_time = True
Type: Cartesian3DPlotLinkingBetweenFrames
-
Cartesian3DFieldPlot.near_plane_fraction¶ position of the “near plane”.
In a 3D plot, the “near plane” acts as a windshield. Anything in front of this plane does not display. Example usage:
>>> plot.near_plane_fraction = 0.1
Type: float
-
Cartesian3DFieldPlot.num_fieldmaps¶ Number of all fieldmaps in this plot.
Example usage:
>>> print(frame.plot().num_fieldmaps) 3
Type: int
-
Cartesian3DFieldPlot.num_solution_times¶ Number of solution times for all active fieldmaps.
Note
This only returns the number of active solution times. When assigning strands and solution times to zones, the zones are placed into an inactive fieldmap that must be subsequently activated. See example below.
>>> # place all zones into a single fieldmap (strand: 1) >>> # with incrementing solution times >>> for time, zone in enumerate(dataset.zones()): ... zone.strand = 1 ... zone.solution_time = time ... >>> # We must activate the fieldmap to ensure the plot's >>> # solution times have been updated. Since we placed >>> # all zones into a single fieldmap, we can assume the >>> # first fieldmap (index: 0) is the one we want. >>> plot.active_fieldmaps += [0] >>> >>> # now the plot's solution times are available. >>> print(plot.num_solution_times) 10 >>> print(plot.solution_times) [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: int
-
Cartesian3DFieldPlot.perform_extra_sorting¶ Use a more robust depth sorting algorithm for display.
When printing 3D plots in a vector graphics format, Tecplot 360 must sort the objects so that it can draw those farthest from the screen first and those closest to the screen last. By default, Tecplot 360 uses a quick sorting algorithm. This is not always accurate and does not detect problems such as intersecting objects. When
perform_extra_sortingset toTrue, Tecplot 360 uses a slower, more accurate approach that detects and resolves such problems. Example usage:>>> plot.perform_extra_sorting = True
Type: bool
-
Cartesian3DFieldPlot.rgb_coloring¶ RGB contour flooding style control.
Example usage:
>>> plot.rgb_coloring.red_variable = dataset.variable('gas') >>> plot.rgb_coloring.green_variable = dataset.variable('oil') >>> plot.rgb_coloring.blue_variable = dataset.variable('water') >>> plot.show_contour = True >>> for fmap in plot.fieldmaps(): ... fmap.contour.flood_contour_group = plot.rgb_coloring
Type: RGBColoring
-
Cartesian3DFieldPlot.scatter¶ Plot-local
Scatterstyle control.Example usage:
>>> scatter = frame.plot().scatter >>> scatter.variable = dataset.variable('P')
Type: Scatter
-
Cartesian3DFieldPlot.show_contour¶ Enable contours for this plot.
Example usage:
>>> frame.plot().show_contour = True
Type: bool
-
Cartesian3DFieldPlot.show_edge¶ Enable zone edge lines for this plot.
Example usage:
>>> frame.plot().show_edge = True
Type: bool
-
Cartesian3DFieldPlot.show_isosurfaces¶ Show isosurfaces for this plot.
- Example usage::
- >>>frame.plot().show_isosurfaces(True)
Type: bool
-
Cartesian3DFieldPlot.show_mesh¶ Enable mesh lines for this plot.
Example usage:
>>> frame.plot().show_mesh = True
Type: bool
-
Cartesian3DFieldPlot.show_scatter¶ Enable scatter symbols for this plot.
Example usage:
>>> frame.plot().show_scatter = True
Type: bool
-
Cartesian3DFieldPlot.show_shade¶ Enable surface shading effect for this plot.
Example usage:
>>> frame.plot().show_shade = True
Type: bool
-
Cartesian3DFieldPlot.show_slices¶ Show slices for this plot.
- Example usage::
- >>>frame.plot().show_slices(True)
Type: bool
-
Cartesian3DFieldPlot.show_streamtraces¶ Enable drawing
Streamtraceson this plot.Example usage:
>>> frame.plot().show_streamtraces = True
Type: bool
-
Cartesian3DFieldPlot.show_vector¶ Enable drawing of vectors.
Example usage:
>>> frame.plot().show_vector = True
Type: bool
-
Cartesian3DFieldPlot.slice(index)[source]¶ SliceGroup: Plot-localslicestyle control.Example usage:
>>> slice_0 = frame.plot().slice(0) >>> slice_0.mesh.color = Color.Blue
-
Cartesian3DFieldPlot.solution_time¶ The current solution time.
Example usage:
>>> print(plot.solution_times) [0.0, 1.0, 2.0] >>> plot.solution_time = 1.0
Note
Possible side-effect when connected to Tecplot 360.
Changing the solution times in the dataset or modifying the active fieldmaps in a frame may trigger a change in the active plot’s solution time by the Tecplot 360 interface. This is done to keep the GUI controls consistent. In batch mode, no such side-effect will take place and the user must take care to set the plot’s solution time with the
plot.solution_timeorplot.solution_timestepproperties.New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: float
-
Cartesian3DFieldPlot.solution_times¶ Listof active solution times.Note
This only returns the list of active solution times. When assigning strands and solution times to zones, the zones are placed into an inactive fieldmap that must be subsequently activated. See example below.
Example usage:
>>> print(plot.solution_times) [0.0, 1.0, 2.0]
New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: listoffloats
-
Cartesian3DFieldPlot.solution_timestep¶ The zero-based index of the current solution time.
A negative index is interpreted as counting from the end of the available solution timesteps. Example usage:
>>> print(plot.solution_times) [0.0, 1.0, 2.0] >>> print(plot.solution_time) 0.0 >>> plot.solution_timestep += 1 >>> print(plot.solution_time) 1.0
Note
Possible side-effect when connected to Tecplot 360.
Changing the solution times in the dataset or modifying the active fieldmaps in a frame may trigger a change in the active plot’s solution time by the Tecplot 360 interface. This is done to keep the GUI controls consistent. In batch mode, no such side-effect will take place and the user must take care to set the plot’s solution time with the
plot.solution_timeorplot.solution_timestepproperties.New in version 2017.2: Solution time manipulation requires Tecplot 360 2017 R2 or later.
Type: int
-
Cartesian3DFieldPlot.streamtraces¶ Plot-local
streamtraceattributes.Example usage:
>>> streamtraces = frame.plot().streamtraces >>> streamtraces.color = Color.Blue
Type: Streamtraces
-
Cartesian3DFieldPlot.symbol_lift_fraction¶ Lift symbols above plot by percentage distance to the eye.
Example usage:
>>> plot.symbol_lift_fraction = 0.6
Type: float
-
Cartesian3DFieldPlot.use_lighting_effect¶ Enable lighting effect for all objects within this plot.
Example usage:
>>> frame.plot().use_lighting_effect = True
Type: bool
-
Cartesian3DFieldPlot.use_translucency¶ Enable translucent effect for all objects within this plot.
Example usage:
>>> frame.plot().use_translucency = True
Type: bool
-
Cartesian3DFieldPlot.value_blanking¶ Mask off cells by value.
Example usage:
>>> plot.value_blanking.constraint(0).comparison_value = 3.14 >>> plot.value_blanking.constraint(0).active = True
Type: ValueBlanking
-
Cartesian3DFieldPlot.vector¶ Vector variable and style control for this plot.
Example usage:
>>> plot.vector.u_variable = dataset.variable('U')
Type: Vector3D
-
Cartesian3DFieldPlot.vector_lift_fraction¶ Lift vectors above plot by percentage distance to the eye.
Example usage:
>>> plot.vector_lift_fraction = 0.6
Type: float
-
Cartesian3DFieldPlot.view¶ Viewport, axes orientation and limits adjustments.
Example usage:
>>> plot.view.fit()
Type: Cartesian3DView
PolarLinePlot¶
-
class
tecplot.plot.PolarLinePlot(frame)[source]¶ Polar plot with line data and associated style through linemaps.
import numpy as np import tecplot as tp from tecplot.constant import * 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 = r.max() 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 lmap.line.color = Color.Green plot.view.fit() tp.export.save_png('plot_polar.png', 600, supersample=3)
Attributes
active_linemap_indicessetof all active linemaps by index.active_linemapsYields all active linemaps. axesAxes style control for this plot. base_fontDefault typeface style control. data_labelsNode and cell labels. legendLine plot legend style and placement control. linking_between_framesStyle linking between frames. num_linemapsNumber of linemaps held by this plot. show_linesEnable lines for this plot. show_symbolsEnable symbols at line vertices for this plot. value_blankingMask off points by value. viewView control of the plot relative to the frame. Methods
activate()Make this the active plot type on the parent frame. activated()Context to ensure this plot is active. add_linemap([name, zone, r, theta, show])Add a linemap using the specified zone and variables. delete_linemaps(*linemaps)Clear all linemaps within this plot. linemap(pattern)Returns a specific linemap within this plot. linemaps([pattern])Yields linemaps matching the given pattern
-
PolarLinePlot.activate()[source]¶ Make this the active plot type on the parent frame.
Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> plot.activate()
-
PolarLinePlot.activated()¶ Context to ensure this plot is active.
Example usage:
>>> from tecplot.constant import PlotType >>> frame = tecplot.active_frame() >>> frame.plot_type = PlotType.XYLine # set active plot type >>> plot = frame.plot(PlotType.Cartesian3D) # get inactive plot >>> print(frame.plot_type) PlotType.XYLine >>> with plot.activated(): ... print(frame.plot_type) # 3D plot temporarily active PlotType.Cartesian3D >>> print(frame.plot_type) # original plot type restored PlotType.XYLine
-
PolarLinePlot.active_linemap_indices¶ setof all active linemaps by index.Numbers are zero-based indices to the linemaps:
>>> active_indices = plot.active_linemap_indices >>> active_lmaps = [plot.linemap(i) for i in active_indices]
Type: setofintegers
-
PolarLinePlot.active_linemaps¶ Yields all active linemaps.
Returns: XYLinemaporPolarLinemapExample usage:
>>> from tecplot.constant import Color >>> for lmap in plot.active_linemaps: ... lmap.line.color = Color.Blue
-
PolarLinePlot.add_linemap(name=None, zone=None, r=None, theta=None, show=True)[source]¶ Add a linemap using the specified zone and variables.
Parameters: - name (
str) – Name of the linemap which can be used for retrieving withPolarLinePlot.linemap. IfNone, then the linemap will not have a name. Default:None. - zone (Zone) – The data to be used when drawing this
linemap. If
None, then Tecplot Engine will select a Zone. Default:None. - r (
Variable) – Thervariable which must be from the sameDatasetasthetaandzone. IfNone, then Tecplot Engine will select a variable. Default:None. - theta (
Variable) – Thethetavariable which must be from the sameDatasetasrandzone. IfNone, then Tecplot Engine will select a variable. Default:None. - show (
bool, optional) – Enable this linemap as soon as it’s added. (default:True)
Returns: Example usage:
>>> lmap = plot.add_linemap('Line 1', dataset.zone('Zone'), ... dataset.variable('R'), ... dataset.variable('Theta')) >>> lmap.line.line_thickness = 0.8
- name (
-
PolarLinePlot.axes¶ Axes style control for this plot.
Example usage:
>>> from tecplot.constant import PlotType, ThetaMode >>> frame.plot_type = PlotType.PolarLine >>> axes = frame.plot().axes >>> axes.theta_mode = ThetaMode.Radians
Type: PolarLineAxes
-
PolarLinePlot.base_font¶ Default typeface style control.
Example usage:
>>> plot.base_font.typeface = 'Times'
Type: BaseFont
-
PolarLinePlot.data_labels¶ Node and cell labels.
This object controls displaying labels for every node and/or cell in the dataset. Example usage:
>>> plot.data_labels.show_node_labels = True >>> plot.data_labels.step_index = 10
Type: LinePlotDataLabels
-
PolarLinePlot.delete_linemaps(*linemaps)¶ Clear all linemaps within this plot.
Parameters: *linemaps (Linemaps, intorstr) – One or more of the following: Linemaps objects, linemap indices (zero-based) or linemap names. If none are given, all linemaps will be deleted.Example usage:
>>> plot.delete_linemaps() >>> print(plot.num_linemaps) 0
-
PolarLinePlot.legend¶ Line plot legend style and placement control.
Example usage:
>>> plot.legend.show = True
Type: LineLegend
-
PolarLinePlot.linemap(pattern)[source]¶ Returns a specific linemap within this plot.
Parameters: pattern ( int,strorre.Pattern) – Zero-based index, case-insensitiveglob-style pattern stringor a compiledregex pattern instanceused to match the linemaps by name. A negative index is interpreted as counting from the end of the available linemaps.Returns: PolarLinemapcorresponding to pattern orNoneif pattern was passed in as astrorregex pattern instanceand no matching linemap was found.Note
Plots can contain linemaps with identical names and only the first match found is returned. This is not guaranteed to be deterministic and care should be taken to have only linemaps with unique names when this feature is used.
Example usage:
>>> plot.linemap(0).error_bar.show = True
-
PolarLinePlot.linemaps(pattern=None)¶ Yields linemaps matching the given pattern
Parameters: pattern ( strorre.Pattern, optional) – Case-insensitiveglob-style pattern stringor a compiledregex pattern instanceused to match linemap names.Returns: Generator of XYLinemapsorPolarLinemapsdepending on the plot type. All linemaps if pattern is not specified.Example usage:
>>> for lmap in plot.linemaps(): ... lmap.show = True
-
PolarLinePlot.linking_between_frames¶ Style linking between frames.
Example usage:
>>> plot.linking_between_frames.group = 1 >>> plot.linking_between_frames.link_solution_time = True
Type: PolarPlotLinkingBetweenFrames
-
PolarLinePlot.num_linemaps¶ Number of linemaps held by this plot.
Example usage:
>>> print(plot.num_linemaps) 3
Type: int
-
PolarLinePlot.show_lines¶ Enable lines for this plot.
Example usage:
>>> plot.show_lines = True
Type: bool
-
PolarLinePlot.show_symbols¶ Enable symbols at line vertices for this plot.
Example usage:
>>> plot.show_symbols = True
Type: bool
-
PolarLinePlot.value_blanking¶ Mask off points by value.
Example usage:
>>> plot.value_blanking.constraint(0).comparison_value = 3.14 >>> plot.value_blanking.constraint(0).active = True
Type: ValueBlanking
XYLinePlot¶
-
class
tecplot.plot.XYLinePlot(frame)[source]¶ Cartesian plot with line data and associated style through linemaps.
from os import path import tecplot as tp from tecplot.constant import PlotType, FillMode 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.activate() plot.show_symbols = True plot.linemap(0).symbols.fill_mode = FillMode.UseLineColor plot.linemap(0).symbols.size = 1 tp.export.save_png('plot_xyline.png', 600, supersample=3)
Attributes
active_linemap_indicessetof all active linemaps by index.active_linemapsYields all active linemaps. axesAxes style control for this plot. base_fontDefault typeface style control. data_labelsNode and cell labels. legendLine plot legend style and placement control. linking_between_framesStyle linking between frames. num_linemapsNumber of linemaps held by this plot. show_barsEnable bar chart drawing mode for this plot. show_error_barsEnable error bars for this plot. show_linesEnable lines for this plot. show_symbolsEnable symbols at line vertices for this plot. value_blankingMask off points by value. viewView control of the plot relative to the frame. Methods
activate()Make this the active plot type on the parent frame. activated()Context to ensure this plot is active. add_linemap([name, zone, x, y, show])Add a linemap using the specified zone and variables. delete_linemaps(*linemaps)Clear all linemaps within this plot. linemap(pattern)Returns a specific linemap within this plot. linemaps([pattern])Yields linemaps matching the given pattern
-
XYLinePlot.activate()[source]¶ Make this the active plot type on the parent frame.
Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.XYLine) >>> plot.activate()
-
XYLinePlot.activated()¶ Context to ensure this plot is active.
Example usage:
>>> from tecplot.constant import PlotType >>> frame = tecplot.active_frame() >>> frame.plot_type = PlotType.XYLine # set active plot type >>> plot = frame.plot(PlotType.Cartesian3D) # get inactive plot >>> print(frame.plot_type) PlotType.XYLine >>> with plot.activated(): ... print(frame.plot_type) # 3D plot temporarily active PlotType.Cartesian3D >>> print(frame.plot_type) # original plot type restored PlotType.XYLine
-
XYLinePlot.active_linemap_indices¶ setof all active linemaps by index.Numbers are zero-based indices to the linemaps:
>>> active_indices = plot.active_linemap_indices >>> active_lmaps = [plot.linemap(i) for i in active_indices]
Type: setofintegers
-
XYLinePlot.active_linemaps¶ Yields all active linemaps.
Returns: XYLinemaporPolarLinemapExample usage:
>>> from tecplot.constant import Color >>> for lmap in plot.active_linemaps: ... lmap.line.color = Color.Blue
-
XYLinePlot.add_linemap(name=None, zone=None, x=None, y=None, show=True)[source]¶ Add a linemap using the specified zone and variables.
Parameters: - name (
str) – Name of the linemap which can be used for retrieving withXYLinePlot.linemap. IfNone, then the linemap will not have a name. Default:None. - zone (Zone) – The data to be used when drawing this
linemap. If
None, then Tecplot Engine will select a zone. Default:None. - x (
Variable) – Thexvariable which must be from the sameDatasetasyandzone. IfNone, then Tecplot Engine will select an x variable. Default:None. - y (
Variable) – Theyvariable which must be from the sameDatasetasxandzone. IfNone, then Tecplot Engine will select ayvariable. Default:None. - show (
bool, optional) – Enable this linemap as soon as it’s added. (default:True). IfNone, then Tecplot Engine will determine if the linemap should be enabled.
Returns: Example usage:
>>> lmap = plot.add_linemap('Line 1', dataset.zone('Zone'), ... dataset.variable('X'), ... dataset.variable('Y')) >>> lmap.line.line_thickness = 0.8
- name (
-
XYLinePlot.axes¶ Axes style control for this plot.
Example usage:
>>> from tecplot.constant import PlotType, AxisMode >>> frame.plot_type = PlotType.XYLine >>> axes = frame.plot().axes >>> axes.axis_mode = AxisMode.XYDependent >>> axes.xy_ratio = 2
Type: XYLineAxes
-
XYLinePlot.base_font¶ Default typeface style control.
Example usage:
>>> plot.base_font.typeface = 'Times'
Type: BaseFont
-
XYLinePlot.data_labels¶ Node and cell labels.
This object controls displaying labels for every node and/or cell in the dataset. Example usage:
>>> plot.data_labels.show_node_labels = True >>> plot.data_labels.step_index = 10
Type: LinePlotDataLabels
-
XYLinePlot.delete_linemaps(*linemaps)¶ Clear all linemaps within this plot.
Parameters: *linemaps (Linemaps, intorstr) – One or more of the following: Linemaps objects, linemap indices (zero-based) or linemap names. If none are given, all linemaps will be deleted.Example usage:
>>> plot.delete_linemaps() >>> print(plot.num_linemaps) 0
-
XYLinePlot.legend¶ Line plot legend style and placement control.
Example usage:
>>> plot.legend.show = True
Type: LineLegend
-
XYLinePlot.linemap(pattern)[source]¶ Returns a specific linemap within this plot.
Parameters: pattern ( int,strorre.Pattern) – Zero-based index, case-insensitiveglob-style pattern stringor a compiledregex pattern instanceused to match the linemaps by name. A negative index is interpreted as counting from the end of the available linemaps.Returns: XYLinemapcorresponding to pattern orNoneif pattern was passed in as astrorregex pattern instanceand no matching linemap was found.Note
Plots can contain linemaps with identical names and only the first match found is returned. This is not guaranteed to be deterministic and care should be taken to have only linemaps with unique names when this feature is used.
Example usage:
>>> plot.linemap(0).error_bar.show = True
-
XYLinePlot.linemaps(pattern=None)¶ Yields linemaps matching the given pattern
Parameters: pattern ( strorre.Pattern, optional) – Case-insensitiveglob-style pattern stringor a compiledregex pattern instanceused to match linemap names.Returns: Generator of XYLinemapsorPolarLinemapsdepending on the plot type. All linemaps if pattern is not specified.Example usage:
>>> for lmap in plot.linemaps(): ... lmap.show = True
-
XYLinePlot.linking_between_frames¶ Style linking between frames.
Example usage:
>>> plot.linking_between_frames.group = 1 >>> plot.linking_between_frames.link_solution_time = True
Type: XYLinePlotLinkingBetweenFrames
-
XYLinePlot.num_linemaps¶ Number of linemaps held by this plot.
Example usage:
>>> print(plot.num_linemaps) 3
Type: int
-
XYLinePlot.show_bars¶ Enable bar chart drawing mode for this plot.
Example usage:
>>> plot.show_bars = True
Type: bool
-
XYLinePlot.show_error_bars¶ Enable error bars for this plot.
The variable to be used for error bars must be set first on at least one linemap within this plot:
>>> plot.linemap(0).error_bars.variable = dataset.variable('E') >>> plot.show_error_bars = True
Type: bool
-
XYLinePlot.show_lines¶ Enable lines for this plot.
Example usage:
>>> plot.show_lines = True
Type: bool
-
XYLinePlot.show_symbols¶ Enable symbols at line vertices for this plot.
Example usage:
>>> plot.show_symbols = True
Type: bool
-
XYLinePlot.value_blanking¶ Mask off points by value.
Example usage:
>>> plot.value_blanking.constraint(0).comparison_value = 3.14 >>> plot.value_blanking.constraint(0).active = True
Type: ValueBlanking
-
XYLinePlot.view¶ View control of the plot relative to the frame.
Example usage:
>>> plot.view.fit()
Type: XYLineView
SketchPlot¶
-
class
tecplot.plot.SketchPlot(frame, *svargs)[source]¶ A plot space with no data attached.
import tecplot as tp from tecplot.constant import PlotType frame = tp.active_frame() plot = frame.plot(PlotType.Sketch) frame.add_text('Hello, World!', (36, 50), size=34) plot.axes.x_axis.show = True plot.axes.y_axis.show = True tp.export.save_png('plot_sketch.png', 600, supersample=3)
Attributes
axesAxes (x and y) for the sketch plot. linking_between_framesStyle linking between frames. Methods
activate()Make this the active plot type on the parent frame. activated()Context to ensure this plot is active.
-
SketchPlot.activate()[source]¶ Make this the active plot type on the parent frame.
Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.Sketch) >>> plot.activate()
-
SketchPlot.activated()¶ Context to ensure this plot is active.
Example usage:
>>> from tecplot.constant import PlotType >>> frame = tecplot.active_frame() >>> frame.plot_type = PlotType.XYLine # set active plot type >>> plot = frame.plot(PlotType.Cartesian3D) # get inactive plot >>> print(frame.plot_type) PlotType.XYLine >>> with plot.activated(): ... print(frame.plot_type) # 3D plot temporarily active PlotType.Cartesian3D >>> print(frame.plot_type) # original plot type restored PlotType.XYLine
-
SketchPlot.axes¶ Axes (x and y) for the sketch plot.
Example usage:
>>> from tecplot.constant import PlotType >>> frame.plot_type = PlotType.Sketch >>> frame.plot().axes.x_axis.show = True
Type: SketchAxes
-
SketchPlot.linking_between_frames¶ Style linking between frames.
Example usage:
>>> plot.linking_between_frames.group = 1 >>> plot.linking_between_frames.link_solution_time = True
Type: SketchPlotLinkingBetweenFrames
Fieldmaps¶
Cartesian2DFieldmap¶
-
class
tecplot.plot.Cartesian2DFieldmap(index, plot)[source]¶ Attributes
contourStyle including flooding, lines and line coloring. edgeStyle control for boundary lines. effectsFieldmapEffectsstyle control for clipping and blanking effects.groupZero-based group number for this Fieldmaps. meshStyle lines connecting neighboring data points. pointsControl which points to draw. scatterStyle for scatter plots. shadeFieldmapShadestyle control for surface shading.showDisplay this fieldmap on the plot. show_iso_surfacesEnable drawing of Iso-surfaces. show_slicesEnable drawing of slice surfaces. show_streamtracesEnable drawing of streamtraces. surfacesControl which surfaces to draw. vectorStyle for vector field plots using arrows. zonesList of zones used by this fieldmap.
-
Cartesian2DFieldmap.contour¶ Style including flooding, lines and line coloring.
Type: FieldmapContour
-
Cartesian2DFieldmap.edge¶ Style control for boundary lines.
Type: FieldmapEdge
-
Cartesian2DFieldmap.effects¶ FieldmapEffectsstyle control for clipping and blanking effects.Type: FieldmapEffects
-
Cartesian2DFieldmap.group¶ Zero-based group number for this Fieldmaps.
This is a piece of auxiliary data and can be useful for identifying a subset of fieldmaps. For example, to loop over all fieldmaps that have group set to 4:
>>> plot.fieldmap(0).group = 4 >>> plot.fieldmap(3).group = 4 >>> for fmap in filter(lambda f: f.group == 4, plot.fieldmaps()): ... print(fmap.index) 0 3
Type: int
-
Cartesian2DFieldmap.mesh¶ Style lines connecting neighboring data points.
Type: FieldmapMesh
-
Cartesian2DFieldmap.points¶ Control which points to draw.
Type: FieldmapPoints
-
Cartesian2DFieldmap.scatter¶ Style for scatter plots.
Type: FieldmapScatter
-
Cartesian2DFieldmap.shade¶ FieldmapShadestyle control for surface shading.Type: FieldmapShade
-
Cartesian2DFieldmap.show¶ Display this fieldmap on the plot.
Example usage for turning on all fieldmaps:
>>> for fmap in plot.fieldmaps(): ... fmap.show = True
Type: bool
-
Cartesian2DFieldmap.surfaces¶ Control which surfaces to draw.
Type: FieldmapSurfaces
-
Cartesian2DFieldmap.vector¶ Style for vector field plots using arrows.
Type: FieldmapVector
Cartesian3DFieldmap¶
-
class
tecplot.plot.Cartesian3DFieldmap(index, plot)[source]¶ Attributes
contourStyle including flooding, lines and line coloring. edgeStyle control for boundary lines. effectsFieldmapEffects3Dstyle control for blanking and lighting effects.groupZero-based group number for this Fieldmaps. meshStyle lines connecting neighboring data points. pointsControl which points to draw. scatterStyle for scatter plots. shadeFieldmapShade3Dstyle control for surface shading.showDisplay this fieldmap on the plot. show_iso_surfacesEnable drawing of Iso-surfaces. show_slicesEnable drawing of slice surfaces. show_streamtracesEnable drawing of streamtraces. surfacesControl which surfaces to draw. vectorStyle for vector field plots using arrows. zonesList of zones used by this fieldmap.
-
Cartesian3DFieldmap.contour¶ Style including flooding, lines and line coloring.
Type: FieldmapContour
-
Cartesian3DFieldmap.edge¶ Style control for boundary lines.
Type: FieldmapEdge
-
Cartesian3DFieldmap.effects¶ FieldmapEffects3Dstyle control for blanking and lighting effects.Type: FieldmapEffects3D
-
Cartesian3DFieldmap.group¶ Zero-based group number for this Fieldmaps.
This is a piece of auxiliary data and can be useful for identifying a subset of fieldmaps. For example, to loop over all fieldmaps that have group set to 4:
>>> plot.fieldmap(0).group = 4 >>> plot.fieldmap(3).group = 4 >>> for fmap in filter(lambda f: f.group == 4, plot.fieldmaps()): ... print(fmap.index) 0 3
Type: int
-
Cartesian3DFieldmap.mesh¶ Style lines connecting neighboring data points.
Type: FieldmapMesh
-
Cartesian3DFieldmap.points¶ Control which points to draw.
Type: FieldmapPoints
-
Cartesian3DFieldmap.scatter¶ Style for scatter plots.
Type: FieldmapScatter
-
Cartesian3DFieldmap.shade¶ FieldmapShade3Dstyle control for surface shading.Type: FieldmapShade3D
-
Cartesian3DFieldmap.show¶ Display this fieldmap on the plot.
Example usage for turning on all fieldmaps:
>>> for fmap in plot.fieldmaps(): ... fmap.show = True
Type: bool
-
Cartesian3DFieldmap.surfaces¶ Control which surfaces to draw.
Type: FieldmapSurfaces
-
Cartesian3DFieldmap.vector¶ Style for vector field plots using arrows.
Type: FieldmapVector
FieldmapContour¶
-
class
tecplot.plot.FieldmapContour(fieldmap)[source]¶ Style control for flooding and contour lines.
This object controls which contour groups are associated with flooding, line placement and line coloring. Three different contour groups may be used though there are eight total groups that can be configured in a single plot. In this example, we flood by the first contour group (index: 0):
import numpy as np import tecplot as tp from tecplot.constant import * from tecplot.data.operate import execute_equation # Get the active frame, setup a grid (30x30x30) # where each dimension ranges from 0 to 30. # Add variables P,Q,R to the dataset and give # values to the data. frame = tp.active_frame() dataset = frame.dataset for v in ['X','Y','Z','P','Q','R']: dataset.add_variable(v) zone = dataset.add_ordered_zone('Zone', (30,30,30)) xx = np.linspace(0,30,30) for v,arr in zip(['X','Y','Z'],np.meshgrid(xx,xx,xx)): zone.values(v)[:] = arr.ravel() execute_equation('{P} = -10 * {X} + {Y}**2 + {Z}**2') execute_equation('{Q} = {X} - 10 * {Y} - {Z}**2') execute_equation('{R} = {X}**2 + {Y}**2 - {Z} ') # Enable 3D field plot and turn on contouring # with boundary faces frame.plot_type = PlotType.Cartesian3D plot = frame.plot() srf = plot.fieldmap(0).surfaces srf.surfaces_to_plot = SurfacesToPlot.BoundaryFaces plot.show_contour = True # get the contour group associated with the # newly created zone contour = plot.fieldmap(dataset.zone('Zone')).contour # assign flooding to the first contour group contour.flood_contour_group = plot.contour(0) contour.flood_contour_group.variable = dataset.variable('P') contour.flood_contour_group.colormap_name = 'Sequential - Yellow/Green/Blue' contour.flood_contour_group.legend.show = False # save image to PNG file tp.export.save_png('fieldmap_contour.png', 600, supersample=3)
Attributes
contour_typeContourTypeto plot.flood_contour_groupThe ContourGroupto use for flooding.flood_contour_group_indexZero-based Indexof theContourGroupto use for flooding.line_colorThe ColororContourGroupfor lines.line_groupContourGroupto use for line placement and style.line_group_indexZero-based Indexof theContourGroupfor contour lines.line_patternLinePatterntype to use for contour lines.line_thicknessThickness ( float) of the drawn lines.pattern_lengthLength ( float) of the pattern segment for non-solid lines.showEnable drawing the contours. use_lighting_effectEnable lighting effect on this contour.
-
FieldmapContour.contour_type¶ ContourTypeto plot.Possible values are:
ContourType.Flood(default)- Filled color between the contour levels.
ContourType.Lines- Lines only.
ContourType.Overlay- Lines overlayed on flood.
ContourType.AverageCell- Filled color by the average value within cells.
ContourType.PrimaryValue- Filled color by the value at the primary corner of the cells.
In this example, we enable both flooding and contour lines:
>>> from tecplot.constant import ContourType >>> contour = plot.fieldmap(0).contour >>> contour.contour_type = ContourType.Overlay
Type: ContourType
-
FieldmapContour.flood_contour_group¶ The
ContourGroupto use for flooding.This property sets and gets the
ContourGroupused for flooding. Changing style on thisContourGroupwill affect all other fieldmaps on the sameFramethat use it. Example usage:>>> cmap_name = 'Sequential - Yellow/Green/Blue' >>> contour = plot.fieldmap(0).contour >>> contour.flood_contour_group = plot.contour(1) >>> contour.flood_contour_group.variable = dataset.variable('P') >>> contour.flood_contour_group.colormap_name = cmap_name
Setting this to the
RGBColoringinstance floods this fieldmap contour by the plot’s RGB coloring settings. This requires that variables are assigned to the red, green and blue color channels:>>> plot.rgb_coloring.red_variable = dataset.variable('x') >>> plot.rgb_coloring.green_variable = dataset.variable('y') >>> plot.rgb_coloring.blue_variable = dataset.variable('z') >>> plot.fieldmap(0).flood_contour_group = plot.rgb_coloring
See
RGBColoringfor more details.Type: ContourGrouporRGBColoring
-
FieldmapContour.flood_contour_group_index¶ Zero-based
Indexof theContourGroupto use for flooding.This property sets and gets, by
Index, theContourGroupused for flooding. Changing style on thisContourGroupwill affect all other fieldmaps on the sameFramethat use it. Example usage:>>> contour = plot.fieldmap(0).contour >>> contour.flood_contour_group_index = 1 >>> contour.flood_contour_group.variable = dataset.variable('P')
Note
To set the flood contour to RGB (multivariate) coloring, you must set the
FieldmapContour.flood_contour_groupproperty toplot.rgb_coloring. SeeFieldmapContour.flood_contour_groupfor more details.Type: int
-
FieldmapContour.line_color¶ The
ColororContourGroupfor lines.FieldmapContour lines can be a solid color or be colored by a
ContourGroupas obtained through theplot.contourproperty. Note that changing style on thisContourGroupwill affect all other fieldmaps on the sameFramethat use it. Example usage:>>> from tecplot.constant import Color >>> contour = plot.fieldmap(1).contour >>> contour.line_color = Color.Blue
Example of setting the color from a
ContourGroup:>>> contour = plot.fieldmap(0).contour >>> contour.line_color = plot.contour(1) >>> contour.line_color.variable = dataset.variable('P')
Setting this to the
RGBColoringinstance colors the lines by the plot’s multivariate contour settings. This requires that variables are assigned to the red, green and blue color channels:>>> plot.rgb_coloring.red_variable = dataset.variable('x') >>> plot.rgb_coloring.green_variable = dataset.variable('y') >>> plot.rgb_coloring.blue_variable = dataset.variable('z') >>> plot.fieldmap(0).line_color = plot.rgb_coloring
See
RGBColoringfor more details.Type: ColororContourGroup
-
FieldmapContour.line_group¶ ContourGroupto use for line placement and style.This property sets and gets the
ContourGroupused for line placement and though all properties of theContourGroupcan be manipulated through this object, many of them such as color will not effect the lines unless theFieldmapContour.line_coloris set to the sameContourGroup. Note that changing style on thisContourGroupwill affect all other fieldmaps on the sameFramethat use it. Example usage:>>> contour = plot.fieldmap(0).contour >>> contour.line_group = plot.contour(2) >>> contour.line_group.variable = dataset.variable('Z')
Type: ContourGroup
-
FieldmapContour.line_group_index¶ Zero-based
Indexof theContourGroupfor contour lines.This property sets and gets, by
Index, theContourGroupused for line placement and though all properties of theContourGroupcan be manipulated through this object, many of them such as color will not affect the lines unless theFieldmapContour.line_coloris set to the sameContourGroup. Note that changing style on thisContourGroupwill affect all other fieldmaps on the sameFramethat use it. Example usage:>>> contour = plot.fieldmap(0).contour >>> contour.line_group_index = 2 >>> contour.line_group.variable = dataset.variable('Z')
Type: int
-
FieldmapContour.line_pattern¶ LinePatterntype to use for contour lines.Possible values:
Solid,Dashed,DashDot,Dotted,LongDash,DashDotDot.Example usage:
>>> from tecplot.constant import LinePattern >>> contour = plot.fieldmap(0).contour >>> contour.line_pattern = LinePattern.DashDotDot
Type: LinePattern
-
FieldmapContour.line_thickness¶ Thickness (
float) of the drawn lines.This is the line thickness in percentage of the
Frame’s height. Example usage:>>> contour = plot.fieldmap(0).contour >>> contour.line_thickness = 0.7
Type: float
-
FieldmapContour.pattern_length¶ Length (
float) of the pattern segment for non-solid lines.This is the pattern length in percentage of the
Frame’s height. Example usage:>>> contour = plot.fieldmap(0).contour >>> contour.pattern_length = 3.5
Type: float
FieldmapEdge¶
-
class
tecplot.plot.FieldmapEdge(fieldmap)[source]¶ Volume boundary lines.
An edge plot layer displays the connections of the outer lines (
IJ-ordered zones), finite element surface zones, or planes (IJK-ordered zones). The FieldmapEdge layer allows you to display the edges (creases and borders) of your data. Zone edges exist only for ordered zones or 2D finite element zones. Three-dimensional finite element zones do not have boundaries:import os import tecplot as tp from tecplot.constant import Color, EdgeType, PlotType, SurfacesToPlot examples_dir = tp.session.tecplot_examples_directory() datafile = os.path.join(examples_dir, 'SimpleData', 'F18.plt') dataset = tp.data.load_tecplot(datafile) frame = dataset.frame # Enable 3D field plot, turn on contouring and translucency frame.plot_type = PlotType.Cartesian3D plot = frame.plot() plot.show_contour = True plot.show_edge = True plot.contour(0).colormap_name = 'Sequential - Blue' # adjust effects for every fieldmap in this dataset for zone in dataset.zones(): fmap = plot.fieldmap(zone) fmap.contour.flood_contour_group.variable = dataset.variable('S') fmap.surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces edge = fmap.edge edge.edge_type = EdgeType.Creases edge.color = Color.RedOrange edge.line_thickness = 0.7 # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() # save image to file tp.export.save_png('fieldmap_edge.png', 600, supersample=3)
Attributes
colorLine Color.edge_typeWhere to draw edge lines. i_borderWhich border lines to draw in the I-dimension.j_borderWhich border lines to draw in the J-dimension.k_borderWhich border lines to draw in the K-dimension.line_thicknessThickness of the edge lines drawn. showDraw the mesh for this fieldmap.
-
FieldmapEdge.edge_type¶ Where to draw edge lines.
Possible values:
Borders,Creases,BordersAndCreases.Example usage:
>>> from tecplot.constant import EdgeType >>> plot.show_edge = True >>> plot.fieldmap(0).edge.edge_type = EdgeType.Creases
Type: EdgeType
-
FieldmapEdge.i_border¶ Which border lines to draw in the
I-dimension.Possible values:
None,Min,Max,Both.Example usage:
>>> from tecplot.constant import BorderLocation >>> plot.show_edge = True >>> plot.fieldmap(0).edge.i_border = BorderLocation.Min
Type: BorderLocation
-
FieldmapEdge.j_border¶ Which border lines to draw in the
J-dimension.Possible values:
None,Min,Max,Both.Example usage:
>>> from tecplot.constant import BorderLocation >>> plot.show_edge = True >>> plot.fieldmap(0).edge.j_border = BorderLocation.Both
Type: BorderLocation
-
FieldmapEdge.k_border¶ Which border lines to draw in the
K-dimension.Possible values:
None,Min,Max,Both.Example usage:
>>> from tecplot.constant import BorderLocation >>> plot.show_edge = True >>> plot.fieldmap(0).edge.k_border = None
Type: BorderLocation
FieldmapEffects¶
-
class
tecplot.plot.FieldmapEffects(fieldmap)[source]¶ Clipping and blanking style control.
This object controls value blanking and clipping from plane slices for this fieldmap.
Attributes
clip_planesClip planes to use when drawing this fieldmap. value_blankingEnable value blanking effect for this fieldmap.
FieldmapEffects3D¶
-
class
tecplot.plot.FieldmapEffects3D(fieldmap)[source]¶ Lighting and translucency style control.
import os import tecplot as tp from tecplot.constant import LightingEffect, PlotType, SurfacesToPlot examples_dir = tp.session.tecplot_examples_directory() datafile = os.path.join(examples_dir, 'SimpleData', 'F18.plt') dataset = tp.data.load_tecplot(datafile) frame = dataset.frame # Enable 3D field plot, turn on contouring and translucency frame.plot_type = PlotType.Cartesian3D plot = frame.plot() plot.show_contour = True plot.use_translucency = True # adjust effects for every fieldmap in this dataset for zone in dataset.zones(): fmap = plot.fieldmap(zone) fmap.contour.flood_contour_group.variable = dataset.variable('S') fmap.surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces eff = fmap.effects eff.lighting_effect = LightingEffect.Paneled eff.surface_translucency = 30 # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() # save image to file tp.export.save_png('fieldmap_effects3d.png', 600, supersample=3)
Attributes
clip_planesClip planes to use when drawing this fieldmap. lighting_effectThe type of lighting effect to render. surface_translucencyintTranslucency of all surfaces for this fieldmap in percent.use_translucencyEnable translucency of all drawn surfaces for this fieldmap. value_blankingEnable value blanking effect for this fieldmap.
-
FieldmapEffects3D.clip_planes¶ Clip planes to use when drawing this fieldmap.
Example usage:
>>> plot.fieldmap(0).effects.clip_planes = [0,1,2]
Type: listofintegers[0-5] orNone
-
FieldmapEffects3D.lighting_effect¶ The type of lighting effect to render.
Possible values:
Paneled- Within each cell, the color assigned to each area by shading or contour flooding is tinted by a shade constant across the cell. This shade is based on the orientation of the cell relative to your 3D light source.
Gouraud- This plot type offers smoother, more continuous shading than
Paneledshading, but it results in slower plotting and larger vector images.Gouraudshading is not continuous across zone boundaries unless face neighbors are specified in the data and is not available for finite element volume zones when blanking is active in which case, the zone’s lighting effect reverts toPaneledshading in this case.
If
IJK-ordered data withFieldmapSurfaces.surfaces_to_plotis set toSurfacesToPlot.ExposedCellFaces, faces exposed by blanking will revert toPaneledshading.Example usage:
>>> from tecplot.constant import LightingEffect >>> effects = plot.fieldmap(0).effects >>> effects.lighting_effect = LightingEffect.Paneled
Type: LightingEffect
-
FieldmapEffects3D.surface_translucency¶ intTranslucency of all surfaces for this fieldmap in percent.The
use_translucencyattribute must be set toTrue:>>> effects = plot.fieldmap(0).effects >>> effects.use_translucency = True >>> effects.surface_translucency = 50
FieldmapMesh¶
-
class
tecplot.plot.FieldmapMesh(fieldmap)[source]¶ Lines connecting neighboring data points.
The mesh plot layer displays the lines connecting neighboring data points within a Zone. For
I-ordered data, the mesh is a single line connecting all of the points in order of increasingI-index. ForIJ-ordered data, the mesh consists of two families of lines connecting adjacent data points of increasingI-index and increasingJ-index. ForIJK-ordered data, the mesh consists of three families of lines, one connecting points of increasingI-index, one connecting points of increasingJ-index, and one connecting points of increasingK-index. For finite element zones, the mesh is a plot of every edge of all of the elements that are defined by the connectivity list for the node points:from os import path import numpy as np import tecplot as tp from tecplot.constant import PlotType, MeshType examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'F18.plt') dataset = tp.data.load_tecplot(infile) # Enable 3D field plot and turn on contouring frame = tp.active_frame() frame.plot_type = PlotType.Cartesian3D plot = frame.plot() plot.show_mesh = True contour = plot.contour(0) contour.variable = dataset.variable('S') contour.colormap_name = 'Doppler' contour.levels.reset_levels(np.linspace(0.02,0.12,11)) # set the mesh type and color for all zones for zone in dataset.zones(): mesh = plot.fieldmap(zone).mesh mesh.mesh_type = MeshType.HiddenLine mesh.color = contour # save image to file tp.export.save_png('fieldmap_mesh.png', 600, supersample=3)
Attributes
colorThe ColororContourGroupfor lines.line_patternLinePatterntype to use for mesh lines.line_thicknessThickness ( float) of the drawn lines.mesh_typeMeshTypeto show.pattern_lengthLength ( float) of the pattern segment for non-solid lines.showDraw the mesh for this fieldmap.
-
FieldmapMesh.color¶ The
ColororContourGroupfor lines.FieldmapContour lines can be a solid color or be colored by a
ContourGroupas obtained through theplot.contourproperty. Note that changing style on thisContourGroupwill affect all other fieldmaps on the sameFramethat use it. Example usage:>>> from tecplot.constant import Color >>> plot.fieldmap(1).mesh.color = Color.Blue
Example of setting the color from a
ContourGroup:>>> plot.fieldmap(1).mesh.color = plot.contour(1)
Type: ColororContourGroup
-
FieldmapMesh.line_pattern¶ LinePatterntype to use for mesh lines.Possible values:
Solid,Dashed,DashDot,Dotted,LongDash,DashDotDot.Example usage:
>>> from tecplot.constant import LinePattern >>> mesh = plot.fieldmap(0).mesh >>> mesh.line_pattern = LinePattern.Dashed
Type: LinePattern
-
FieldmapMesh.line_thickness¶ Thickness (
float) of the drawn lines.This is the line thickness in percentage of the
Frame’s height. Example usage:>>> plot.fieldmap(0).mesh.line_thickness = 0.7
Type: float
-
FieldmapMesh.mesh_type¶ MeshTypeto show.Possible values:
WireframeWire frame meshes are drawn below any other zone layers on the same zone. In 3D Cartesian plots, no hidden lines are removed. For 3D volume zones (finite element volume or IJK-ordered), the full 3D mesh (consisting of all the connecting lines between data points) is not generally drawn because the sheer number of lines would make it confusing. The mesh drawn will depend on
FieldmapSurfaceswhich can be obtained through the parent fieldmap withmesh.fieldmap.surfaces:from tecplot.constant import MeshType, SurfacesToPlot mesh = plot.fieldmap(0).mesh mesh.mesh_type = MeshType.Wireframe surfaces = mesh.fieldmap.surfaces surfaces.surfaces_to_plot = SurfacesToPlot.IPlanes
By default, only the mesh on exposed cell faces is shown.
Overlay- Similar to Wire Frame, mesh lines are drawn over all other zone
layers except for vectors and scatter symbols. In 3D Cartesian
plots, the area behind the cells of the plot is still visible
(unless another plot type such as contour flooding prevents this).
As with Wire Frame, the mesh drawn will depend on
FieldmapSurfaceswhich can be obtained through the parent fieldmap withmesh.fieldmap.surfaces. HiddenLineSimilar to Overlay, except hidden lines are removed from behind the mesh. In effect, the cells (elements) of the mesh are opaque. FieldmapSurfaces and lines that are hidden behind another surface are removed from the plot. For 3D volume zones, using this plot type obscures everything inside the zone. If you choose this option for 3D volume zones, then choosing to plot every surface with:
from tecplot.constant import HiddenLine, SurfacesToPlot mesh = plot.fieldmap(0).mesh mesh.mesh_type = MeshType.HiddenLine surfaces = mesh.fieldmap.surfaces surfaces.surfaces_to_plot = SurfacesToPlot.All
has the same effect as plotting only exposed cell faces with:
surfaces.surfaces_to_plot = SurfacesToPlot.ExposedCellFaces
but is much slower.
Type: MeshType
FieldmapPoints¶
-
class
tecplot.plot.FieldmapPoints(fieldmap)[source]¶ Type and density of the points used for vector and scatter plots.
This object controls the location of the points for
FieldmapVectorandFieldmapScatterplots relative to the cells:from os import path import tecplot as tp from tecplot.constant import PlotType, PointsToPlot examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'HeatExchanger.plt') dataset = tp.data.load_tecplot(infile) # Enable 3D field plot and turn on contouring frame = tp.active_frame() frame.plot_type = PlotType.Cartesian2D plot = frame.plot() plot.vector.u_variable = dataset.variable('U(M/S)') plot.vector.v_variable = dataset.variable('V(M/S)') plot.show_vector = True for zone in dataset.zones(): points = plot.fieldmap(zone).points points.points_to_plot = PointsToPlot.SurfaceCellCenters points.step = (2,2) # save image to file tp.export.save_png('fieldmap_points.png', 600, supersample=3)
Attributes
points_to_plotLocation of the points to show. stepStep along the dimensions (I, J, K).
-
FieldmapPoints.points_to_plot¶ Location of the points to show.
Possible values:
SurfaceNodes- Draws only the nodes that are on the surface of the Zone.
AllNodes- Draws all nodes in the Zone.
SurfaceCellCenters- Draws points at the cell centers which are on or near the surface of the Zone.
AllCellCenters- Draws points at all cell centers in the Zone.
AllConnected- Draws all the nodes that are connected by the node map. Nodes without any connectivity are not drawn.
Example usage:
>>> from tecplot.constant import PointsToPlot >>> pts = plot.fieldmap(0).points >>> sts.points_to_plot = PointsToPlot.SurfaceCellCenters
Type: PointsToPlot
-
FieldmapPoints.step¶ Step along the dimensions
(I, J, K).This property specifies the
I,J, andK-step intervals. For irregular and finite element data, only the first parameter orI-Step has an effect. This steps through the nodes in the order they are listed in the data file. In this case, a single number can be given, but note that the return type is always a 3-tuplefor both ordered and irregular data.Example for
IJKordered data:>>> plot.fieldmap(0).points.step = (10,10,None) >>> print(plot.fieldmap(0).points.step) (10, 10, 1)
Example for irregular data:
>>> plot.fieldmap(0).points.step = 10 >>> print(plot.fieldmap(0).points.step) (10, 1, 1)
Type: tuple
FieldmapScatter¶
-
class
tecplot.plot.FieldmapScatter(fieldmap)[source]¶ Plot of nodes using symbols.
FieldmapScatterplots display symbols at the data points in a field. The symbols may be sized according to the values of a specified variable, colored by the values of the contour variable, or may be uniformly sized or colored. Unlike contour plots, scatter plots do not require any mesh structure connecting the points, allowing scatter plots of irregular data:from os import path import tecplot as tp from tecplot.constant import PlotType, SymbolType, FillMode 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() frame.plot_type = PlotType.Cartesian2D plot = frame.plot() plot.show_scatter = True for z in dataset.zones(): scatter = plot.fieldmap(z).scatter scatter.symbol_type = SymbolType.Geometry scatter.fill_mode = FillMode.UseSpecificColor scatter.fill_color = plot.contour(0) scatter.size = 1 # ensure consistent output between interactive (connected) and batch plot.contour(0).levels.reset_to_nice() tp.export.save_png('fieldmap_scatter.png', 600, supersample=3)
Attributes
colorLine ColororContourGroupof the drawn symbols.fill_colorFill or background color. fill_modeMode for the background color. line_thicknessWidth of the lines when drawing symbols. showShow the scatter symbols. sizeSize of the symbols to draw. size_by_variableUse a variable to determine relative size of symbols. symbol_typeThe SymbolTypeto use for this scatter plot.Methods
symbol([symbol_type])Returns a scatter symbol style object.
-
FieldmapScatter.color¶ Line
ColororContourGroupof the drawn symbols.This can be a solid color or a
ContourGroupas obtained through theplot.contourproperty. Note that changing style on theContourGroupwill affect all other fieldmaps in the sameFramethat use it. Example usage:>>> from tecplot.constant import Color >>> plot.fieldmap(1).scatter.color = Color.Blue
Example of setting the color from a
ContourGroup:>>> plot.fieldmap(1).scatter.color = plot.contour(1)
Type: ColororContourGroup
-
FieldmapScatter.fill_color¶ Fill or background color.
The
fill_modeattribute must be set accordingly:>>> from tecplot.constant import Color, SymbolType, FillMode >>> scatter = plot.fieldmap(0).scatter >>> scatter.symbol_type = SymbolType.Geometry >>> scatter.fill_mode = FillMode.UseSpecificColor >>> scatter.fill_color = Color.Red
Type: ColororContourGroup
-
FieldmapScatter.fill_mode¶ Mode for the background color.
Options include:
FillMode.UseSpecificColor,FillMode.UseLineColor,FillMode.UseBackgroundColorandFillMode.None_.Example usage:
>>> from tecplot.constant import Color, SymbolType, FillMode >>> scatter = plot.fieldmap(0).scatter >>> scatter.symbol_type = SymbolType.Geometry >>> scatter.fill_mode = FillMode.UseSpecificColor >>> scatter.fill_color = Color.Red
Type: FillMode
-
FieldmapScatter.line_thickness¶ Width of the lines when drawing symbols.
Example usage:
>>> from tecplot.constant import SymbolType >>> scatter = plot.fieldmap(0).scatter >>> scatter.symbol_type = SymbolType.Geometry >>> scatter.line_thickness = 1
Type: float
-
FieldmapScatter.show¶ Show the scatter symbols.
Example usage:
>>> plot.show_scatter = True >>> plot.fieldmap(2).scatter.show = True
Type: bool
-
FieldmapScatter.size¶ Size of the symbols to draw.
Example usage:
>>> plot.fieldmap(0).scatter.size = 4
Type: float
-
FieldmapScatter.size_by_variable¶ Use a variable to determine relative size of symbols.
Example usage:
>>> plot.scatter.variable = dataset.variable('P') >>> plot.fieldmap(0).scatter.size_by_variable = True
See also
Type: bool
-
FieldmapScatter.symbol(symbol_type=None)[source]¶ Returns a scatter symbol style object.
Parameters: symbol_type ( SymbolType, optional) – The type of symbol to return. By default, this will return the active symbol type which is obtained fromFieldmapScatter.symbol_type.Returns:
TextScatterSymbolorGeometryScatterSymbolExample usage:
>>> from tecplot.constant import SymbolType >>> plot.fieldmap(0).scatter.symbol_type = SymbolType.Text >>> symbol = plot.fieldmap(0).scatter.symbol() >>> symbol.text = 'a'
-
FieldmapScatter.symbol_type¶ The
SymbolTypeto use for this scatter plot.Possible values are
SymbolType.GeometryorSymbolType.Text. Example usage:>>> from tecplot.constant import SymbolType >>> plot.fieldmap(0).scatter.symbol_type = SymbolType.Text
Type: SymbolType
GeometryScatterSymbol¶
-
class
tecplot.plot.GeometryScatterSymbol(parent, svarg='SYMBOLSHAPE')[source]¶ Geometric shape for scatter plots.
from os import path import tecplot as tp from tecplot.constant import (Color, PlotType, PointsToPlot, SymbolType, GeomShape, FillMode) 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() frame.plot_type = PlotType.Cartesian2D plot = frame.plot() plot.show_scatter = True for i,fmap in enumerate(plot.fieldmaps()): points = fmap.points points.points_to_plot = PointsToPlot.SurfaceCellCenters points.step = (2,2) scatter = fmap.scatter scatter.color = Color(i) scatter.fill_mode = FillMode.UseSpecificColor scatter.fill_color = Color(i+plot.num_fieldmaps) scatter.size = 2 scatter.line_thickness = 0.5 scatter.symbol_type = SymbolType.Geometry scatter.symbol().shape = GeomShape(i%7) tp.export.save_png('fieldmap_scatter_geometry.png', 600, supersample=3)
Attributes
shapeGeometric shape to use when plotting scatter points.
-
GeometryScatterSymbol.shape¶ Geometric shape to use when plotting scatter points.
Possible values:
Square,Del,Grad,RTri,LTri,Diamond,Circle,Cube,Sphere,Octahedron,Point.Example usage:
>>> from tecplot.constant import SymbolType, GeomShape >>> scatter = plot.fieldmap(0).scatter >>> scatter.symbol_type = SymbolType.Geometry >>> scatter.symbol().shape = GeomShape.Diamond
Type: GeomShape
TextScatterSymbol¶
-
class
tecplot.plot.TextScatterSymbol(parent, svarg='SYMBOLSHAPE')[source]¶ Text character for scatter plots.
Only a single character can be used.
from os import path import tecplot as tp from tecplot.constant import (Color, PlotType, PointsToPlot, SymbolType, GeomShape, FillMode) 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() frame.plot_type = PlotType.Cartesian2D plot = frame.plot() plot.show_shade = True plot.show_scatter = True for i,fmap in enumerate(plot.fieldmaps()): fmap.points.points_to_plot = PointsToPlot.SurfaceCellCenters fmap.points.step = (4,4) fmap.scatter.color = Color((i%4)+13) fmap.scatter.fill_mode = FillMode.UseSpecificColor fmap.scatter.fill_color = Color.Yellow fmap.scatter.size = 3 fmap.scatter.symbol_type = SymbolType.Text fmap.scatter.symbol().text = hex(i)[-1] fmap.shade.color = Color.LightBlue tp.export.save_png('fieldmap_scatter_text.png', 600, supersample=3)
Attributes
font_overrideTypeface to use when rendering text-based scatter. textThe ASCII character to use as the symbol to show use_base_fontUse the base typeface when rendering text-based scatter.
-
TextScatterSymbol.font_override¶ Typeface to use when rendering text-based scatter.
Possible values:
constant.Font.Greek,constant.Font.Mathorconstant.Font.UserDefined.The
use_base_fontattribute must be set toFalse:>>> from tecplot.constant import SymbolType, Font >>> scatter = plot.fieldmap(0).scatter >>> scatter.symbol_type = SymbolType.Text >>> scatter.symbol().use_base_font = False >>> scatter.symbol().font_override = Font.Math
Type: constant.Font
-
TextScatterSymbol.text¶ The ASCII character to use as the symbol to show
Note
This is limited to a single character.
Example usage:
>>> from tecplot.constant import SymbolType >>> scatter = plot.fieldmap(0).scatter >>> scatter.symbol_type = SymbolType.Text >>> scatter.symbol().text = 'X'
-
TextScatterSymbol.use_base_font¶ Use the base typeface when rendering text-based scatter.
When
False, thefont_overrideattribute takes effect:>>> from tecplot.constant import SymbolType, Font >>> scatter = plot.fieldmap(0).scatter >>> scatter.symbol_type = SymbolType.Text >>> scatter.symbol().use_base_font = False >>> scatter.symbol().font_override = Font.Greek
Type: bool
FieldmapShade¶
-
class
tecplot.plot.FieldmapShade(fieldmap)[source]¶ Fill color for displayed surfaces on 2D field plots.
Although most commonly used with 3D surfaces (see
FieldmapShade3D), shade plots can be used to flood 2D plots with solid colors.import os import random import tecplot from tecplot.constant import Color, PlotType random.seed(1) examples_dir = tecplot.session.tecplot_examples_directory() datafile = os.path.join(examples_dir, 'SimpleData', 'F18.plt') dataset = tecplot.data.load_tecplot(datafile) frame = dataset.frame frame.plot_type = PlotType.Cartesian2D plot = frame.plot() for zone in dataset.zones(): color = Color(random.randint(0,63)) while color == Color.White: color = Color(random.randint(0,63)) fmap = plot.fieldmap(zone) fmap.shade.color = color tecplot.export.save_png('fieldmap_shade2d.png', 600, supersample=3)
Attributes
colorFill Colorof the shade.showFieldmapShade the drawn surfaces.
FieldmapShade3D¶
-
class
tecplot.plot.FieldmapShade3D(fieldmap)[source]¶ Fill color for displayed surfaces on 3D field plots.
This class inherits all functionality and purpose from
FieldmapShadeand adds the ability to turn on or off the lighting effect. In 3D plots, fieldmap effects (translucency and lighting) cause color variation (shading) throughout the zones. Shading can can be useful in discerning the shape of the data:import os import random import tecplot from tecplot.constant import Color, PlotType, SurfacesToPlot random.seed(1) examples_dir = tecplot.session.tecplot_examples_directory() datafile = os.path.join(examples_dir, 'SimpleData', 'F18.plt') dataset = tecplot.data.load_tecplot(datafile) frame = dataset.frame frame.plot_type = PlotType.Cartesian3D plot = frame.plot() for zone in dataset.zones(): color = Color(random.randint(0,63)) while color == Color.White: color = Color(random.randint(0,63)) fmap = plot.fieldmap(zone) fmap.surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces fmap.shade.color = color fmap.shade.use_lighting_effect = False tecplot.export.save_png('fieldmap_shade3d.png', 600, supersample=3)
Attributes
colorFill Colorof the shade.showFieldmapShade the drawn surfaces. use_lighting_effectDraw a lighting effect on the shaded surfaces.
-
FieldmapShade3D.color¶ Fill
Colorof the shade.Example usage:
>>> from tecplot.constant import Color >>> plot.fieldmap(0).shade.color = Color.Blue
Type: Color
FieldmapSurfaces¶
-
class
tecplot.plot.FieldmapSurfaces(fieldmap)[source]¶ Plot surfaces from volume data.
This class controls viewing volume data as surfaces, either via a boundary surface or one or more planes along the
I,J,Kdimensions for ordered data:import numpy as np import tecplot as tp from tecplot.constant import * from tecplot.data.operate import execute_equation # Get the active frame, setup a grid (30x30x30) # where each dimension ranges from 0 to 30. # Add variable P to the dataset and give # values to the data. frame = tp.active_frame() dataset = frame.dataset for v in ['X','Y','Z','P']: dataset.add_variable(v) zone = dataset.add_ordered_zone('Zone', (30,30,30)) xx = np.linspace(0,30,30) for v,arr in zip(['X','Y','Z'],np.meshgrid(xx,xx,xx)): zone.values(v)[:] = arr.ravel() execute_equation('{P} = -10*{X} + {Y}**2 + {Z}**2') # Enable 3D field plot and turn on contouring frame.plot_type = PlotType.Cartesian3D plot = frame.plot() plot.show_contour = True # get a handle of the fieldmap for this zone fmap = plot.fieldmap(dataset.zone('Zone')) # set the active contour group to flood by variable P fmap.contour.flood_contour_group.variable = dataset.variable('P') plot.contour(0).levels.reset_to_nice() # show I and J-planes through the surface fmap.surfaces.surfaces_to_plot = SurfacesToPlot.IJPlanes # show only the first and last I-planes # min defaults to 0, max defaults to -1 # we set step to -1 which is equivalent # to the I-dimensions's max fmap.surfaces.i_range = None,None,-1 # show J-planes at indices: [5, 15, 25] fmap.surfaces.j_range = 5,25,10 # save image to file tp.export.save_png('fieldmap_surfaces_ij.png', 600, supersample=3)
Attributes
i_rangeIndexRangefor the I dimension of ordered data.j_rangeIndexRangefor the J dimension of ordered data.k_rangeIndexRangefor the K dimension of ordered data.surfaces_to_plotThe surfaces to show.
-
FieldmapSurfaces.i_range¶ IndexRangefor the I dimension of ordered data.This example shows
I-planes ati = [0, 2, 4, 6, 8, 10]:>>> from tecplot.constant import SurfacesToPlot >>> srf = frame.plot().fieldmap(0).surfaces >>> srf.surfaces_to_plot = SurfacesToPlot.IPlanes >>> srf.i_range = 0, 10, 2
Type: tupleofintegers(min, max, step)
-
FieldmapSurfaces.j_range¶ IndexRangefor the J dimension of ordered data.This example shows all
J-planes starting withj = 10up to the maximumJ-plane of the associated Zone:>>> from tecplot.constant import SurfacesToPlot >>> srf = frame.plot().fieldmap(0).surfaces >>> srf.surfaces_to_plot = SurfacesToPlot.JPlanes >>> srf.j_range = 10, None, 1
Type: tupleofintegers(min, max, step)
-
FieldmapSurfaces.k_range¶ IndexRangefor the K dimension of ordered data.This example shows all
K-planes starting with the first up to 5 from the lastK-plane of the associated Zone:>>> from tecplot.constant import SurfacesToPlot >>> srf = frame.plot().fieldmap(0).surfaces >>> srf.surfaces_to_plot = SurfacesToPlot.KPlanes >>> srf.k_range = None, -5
Type: tupleofintegers(min, max, step)
-
FieldmapSurfaces.surfaces_to_plot¶ The surfaces to show.
Possible values:
BoundaryFaces,ExposedCellFaces,IPlanes,JPlanes,KPlanes,IJPlanes,JKPlanes,IKPlanes,IJKPlanes,All, the python built-inNone.Options such as
IJKPlanesshow planes from multiple dimensions. For example, theIJPlanesvalue shows both theI-planes and theJ-planes. The following example shows a 3D field plot using faces on the boundary:>>> from tecplot.constant import SurfacesToPlot >>> frame.plot_type = PlotType.Cartesian3D >>> srf = frame.plot().fieldmap(0).surfaces >>> srf.surfaces_to_plot = SurfacesToPlot.BoundaryFaces
Type: SurfacesToPlot
FieldmapVector¶
-
class
tecplot.plot.FieldmapVector(fieldmap)[source]¶ Field plot of arrows.
Before doing anything with vector plots, one must set the variables to be used for the
(U, V, W)coordinates. This is done through the plot object. Once set, the vectors can be displayed and manipulated using this class:import numpy as np import tecplot as tp from tecplot.data.operate import execute_equation from tecplot.constant import (PlotType, PointsToPlot, VectorType, ArrowheadStyle) frame = tp.active_frame() dataset = frame.dataset for v in ['X','Y','Z','P','Q','R']: dataset.add_variable(v) zone = dataset.add_ordered_zone('Zone', (30,30,30)) xx = np.linspace(0,30,30) for v,arr in zip(['X','Y','Z'],np.meshgrid(xx,xx,xx)): zone.values(v)[:] = arr.ravel() execute_equation('{P} = -10 * {X} + {Y}**2 + {Z}**2') execute_equation('{Q} = {X} - 10 * {Y} - {Z}**2') execute_equation('{R} = {X}**2 + {Y}**2 - {Z} ') frame.plot_type = PlotType.Cartesian3D plot = frame.plot() plot.contour(0).variable = dataset.variable('P') plot.contour(0).colormap_name = 'Two Color' plot.contour(0).levels.reset_to_nice() plot.vector.u_variable = dataset.variable('P') plot.vector.v_variable = dataset.variable('Q') plot.vector.w_variable = dataset.variable('R') plot.show_vector = True points = plot.fieldmap(0).points points.points_to_plot = PointsToPlot.AllNodes points.step = (5,3,2) vector = plot.fieldmap(0).vector vector.show = True vector.vector_type = VectorType.MidAtPoint vector.arrowhead_style = ArrowheadStyle.Filled vector.color = plot.contour(0) vector.line_thickness = 0.4 # save image to file tp.export.save_png('fieldmap_vector.png', 600, supersample=3)
Attributes
arrowhead_styleThe ArrowheadStyledrawn.colorThe ColororContourGroupto use when drawing vectors.line_patternThe LinePatternused to draw the arrow line.line_thicknessThe width of the arrow line. pattern_lengthLength of the pattern used when drawing vector lines. showEnable drawing vectors on the plot. tangent_onlyShow only tangent vectors. vector_typeAnchor point of the drawn vectors.
-
FieldmapVector.arrowhead_style¶ The
ArrowheadStyledrawn.Possible values:
Plain,Filled,Hollow.Example usage:
>>> from tecplot.constant import ArrowheadStyle >>> plot.fieldmap(0).vector.arrowhead_style = ArrowheadStyle.Filled
Type: ArrowheadStyle
-
FieldmapVector.color¶ The
ColororContourGroupto use when drawing vectors.FieldmapVectors can be a solid color or be colored by a
ContourGroupas obtained through theplot.contourproperty. Note that changing style on thisContourGroupwill affect all other fieldmaps on the sameFramethat use it. Example usage:>>> from tecplot.constant import Color >>> plot.fieldmap(1).vector.color = Color.Blue
Example of setting the color from a
ContourGroup:>>> plot.fieldmap(1).vector.color = plot.contour(1)
Type: ColororContourGroup
-
FieldmapVector.line_pattern¶ The
LinePatternused to draw the arrow line.Possible values:
Solid,Dashed,DashDot,Dotted,LongDash,DashDotDot.Example usage:
>>> from tecplot.constant import LinePattern >>> vector = plot.fieldmap(0).vector >>> vector.line_pattern = LinePattern.DashDot
Type: LinePattern
-
FieldmapVector.line_thickness¶ The width of the arrow line.
Example usage:
>>> from tecplot.constant import LinePattern >>> vector = plot.fieldmap(0).vector.line_thickness = 0.7
Type: float(percentage ofFrameheight)
-
FieldmapVector.pattern_length¶ Length of the pattern used when drawing vector lines.
Example usage:
>>> from tecplot.constant import LinePattern >>> vector = plot.fieldmap(0).vector >>> vector.line_pattern = LinePattern.Dashed >>> vector.pattern_length = 3.5
Type: float(percentage ofFrameheight)
-
FieldmapVector.show¶ Enable drawing vectors on the plot.
Example usage:
>>> plot.show_vector = True >>> plot.fieldmap(0).vector.show = True
Type: bool
-
FieldmapVector.tangent_only¶ Show only tangent vectors.
Set to
Trueto display only the tangent component of vectors. Tangent vectors are drawn on 3D surfaces only where it is possible to determine a vector normal to the surface. A plot where multiple surfaces intersect each other using common nodes is a case where tangent vectors are not drawn because there is more than one normal to choose from. An example of this would be a volumeIJK-ordered zone where both theIandJ-planes are shown. If tangent vectors cannot be drawn, then regular vectors are plotted instead.Example usage:
>>> plot.fieldmap(0).vector.tangent_only = True
Type: bool
-
FieldmapVector.vector_type¶ Anchor point of the drawn vectors.
Possible values:
TailAtPoint,HeadAtPoint,MidAtPoint,HeadOnly.Example usage:
>>> from tecplot.constant import VectorType >>> plot.fieldmap(0).vector.vector_type = VectorType.MidAtPoint
Type: VectorType
Linemaps¶
PolarLinemap¶
-
class
tecplot.plot.PolarLinemap(uid, plot)[source]¶ Attributes
aux_dataAuxiliary data for this linemap. curveLinemapCurvestyle and fitting-method control for lines.function_dependencyThe independent variable for function evalulation. indexZero-based integer identifier for this Linemaps. indicesLinemapIndicesobject controlling which lines are shown.lineLinemapLinestyle for lines to be drawn.nameName identifier of this Linemaps. r_axisRadial axis used by this linemap. r_variable\(r\)-component Variableof the plotted line.r_variable_index\(r\)-component Variableindex of the plotted line.showDisplay this linemap on the plot. show_in_legendShow this Linemaps in the legend. sort_modeMode controlling which Variableto use when sorting lines.sort_variableSpecific Variableused when listing lines.sort_variable_indexZero-based index of the specific Variableused for sorting.symbolsLinemapSymbolsstyle for markers at points along the lines.theta_axisAngular axis used by this linemap. theta_variable:math:` heta`-component Variableof the plotted line.theta_variable_index:math:` heta`-component Variableindex of the plotted line.zoneData source (Zone) for this Linemaps. zone_indexZero-based index of the Zone this Linemaps will draw.
-
PolarLinemap.aux_data¶ Auxiliary data for this linemap.
Returns:
AuxDataThis is the auxiliary data attached to the linemap. Such data is written to the layout file by default and can be retrieved later. Example usage:
>>> from tecplot.constant import PlotType >>> plot = tp.active_frame().plot(PlotType.XYLine) >>> aux = plot.linemap(0).aux_data >>> aux['Result'] = '3.14159' >>> print(aux['Result']) 3.14159
-
PolarLinemap.curve¶ LinemapCurvestyle and fitting-method control for lines.Type: LinemapCurve
-
PolarLinemap.function_dependency¶ The independent variable for function evalulation.
Possible values:
RIndependent,ThetaIndependent. Example usage:>>> from tecplot.constant import FunctionDependency, PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> lmap = plot.linemap(0) >>> lmap.function_dependency = FunctionDependency.ThetaIndependent
Type: FunctionDependency
-
PolarLinemap.index¶ Zero-based integer identifier for this Linemaps.
Example:
>>> lmap = plot.linemap(1) >>> print(lmap.index) 1
Type: int
-
PolarLinemap.indices¶ LinemapIndicesobject controlling which lines are shown.Type: LinemapIndices
-
PolarLinemap.line¶ LinemapLinestyle for lines to be drawn.Type: LinemapLine
-
PolarLinemap.name¶ Name identifier of this Linemaps.
Names are automatically assigned to each mapping. The nature of the name depends on the type of data used to create the mapping. If your data has only one dependent variable, the default is to use the zone name for the mapping. If your data has multiple dependent variables, then the default is to use the dependent variable name for the mapping. In either case each mapping is assigned a special name (
&ZN&or&DN&) that is replaced with the zone or variable name when the name is displayed.Selecting variables in a 3D finite element zone may require significant time, since the variable must be loaded over the entire zone. XY and Polar line plots are best used with linear or ordered data, or with two-dimensional finite element data.
Certain placeholder text will be replaced with values based on elements within the plot. By combining static text with these placeholders, you can construct a name in any format you like:
>>> plot.linemap(2).name = 'Zone: &ZN&'
The placeholders available are:
- Zone name (
&ZN&) - This will be replaced with the actual name of the zone assigned to that mapping.
- Zone number (
&Z#&) - This will be replaced with the actual number of the zone assigned to the mapping.
- Independent variable name (
&IV&) - This will be replaced with the actual name of the independent variable assigned to that mapping.
- Independent variable number (
&I#&) - This will be replaced with the actual number of the independent variable assigned to the mapping.
- Dependent variable name (
&DV&) - This will be replaced with the actual name of the dependent variable assigned to that mapping.
- Dependent variable number (
&D#&) - This will be replaced with the actual number of the dependent variable assigned to the mapping.
- Map number (
&M#&) - This will be replaced with the actual number of the mapping.
- X-Axis number (
&X#&) - This will be replaced with the actual number of the X-axis assigned to that mapping for XY Line plots. This option is not available for Polar Line plots.
- Y-Axis number (
&Y#&) - This will be replaced with the actual number of the Y-axis assigned to that mapping for XY Line plots. This option is not available for Polar Line plots.
Type: str- Zone name (
-
PolarLinemap.r_axis¶ Radial axis used by this linemap.
Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> plot.linemap(0).r_axis.title = 'distance (m)'
Type: RadialLineAxis
-
PolarLinemap.r_variable¶ \(r\)-component
Variableof the plotted line.Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> plot.linemap(0).r_variable = dataset.variable('R')
Type: Variable
-
PolarLinemap.r_variable_index¶ \(r\)-component
Variableindex of the plotted line.Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> plot.linemap(0).r_variable_index = 0
Type: int(Zero-based index)
-
PolarLinemap.show¶ Display this linemap on the plot.
Example usage for turning on all linemaps:
>>> for lmap in plot.linemaps(): ... lmap.show = True
Type: bool
-
PolarLinemap.show_in_legend¶ Show this Linemaps in the legend.
Possible values:
LegendShow.Always- The mapping appears in the legend even if the mapping is turned off (deactivated) or its entry in the table looks exactly like another mapping’s entry.
LegendShow.Never- The mapping never appears in the legend.
LegendShow.Auto(default)- The mapping appears in the legend only when the mapping is turned on. If two mappings would result in the same entry in the legend, only one entry is shown.
Type: LegendShow
-
PolarLinemap.sort_mode¶ Mode controlling which
Variableto use when sorting lines.Possible values:
LineMapSort.BySpecificVar,LineMapSort.ByIndependentVar,LineMapSort.ByDependentVarorLineMapSort.None_.Example usage:
>>> from tecplot.constant import LineMapSort >>> plot.linemap(0).sort_mode = LineMapSort.ByDependentVar
Type: LineMapSort
-
PolarLinemap.sort_variable¶ Specific
Variableused when listing lines.The
sort_modeattribute must be set toLineMapSort.BySpecificVar:>>> from tecplot.constant import LineMapSort >>> plot.linemap(0).sort_by = LineMapSort.BySpecificVar >>> plot.linemap(0).sort_variable = dataset.variable('P')
Type: Variable
-
PolarLinemap.sort_variable_index¶ Zero-based index of the specific
Variableused for sorting.The
sort_modeattribute must be set toLineMapSort.BySpecificVar:>>> from tecplot.constant import LineMapSort >>> plot.linemap(0).sort_by = LineMapSort.BySpecificVar >>> plot.linemap(0).sort_variable_index = 3
Type: int
-
PolarLinemap.symbols¶ LinemapSymbolsstyle for markers at points along the lines.Type: LinemapSymbols
-
PolarLinemap.theta_axis¶ Angular axis used by this linemap.
Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> plot.linemap(0).theta_axis.title = 'angle (deg)'
Type: PolarAngleLineAxis
-
PolarLinemap.theta_variable¶ :math:` heta`-component
Variableof the plotted line.Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> plot.linemap(0).theta_variable = dataset.variable('Theta')
Type: Variable
-
PolarLinemap.theta_variable_index¶ :math:` heta`-component
Variableindex of the plotted line.Example usage:
>>> from tecplot.constant import PlotType >>> plot = frame.plot(PlotType.PolarLine) >>> plot.linemap(0).theta_variable_index = 1
Type: int(Zero-based index)
XYLinemap¶
-
class
tecplot.plot.XYLinemap(uid, plot)[source]¶ Data mapping for 2D Cartesian line plots.
Linemaps connect a specific Zone/
Variablecombination to a line or set of lines, depending on the dimension of the data if ordered. Linemaps can share any of the axes available in the plot and orientation can be verical or horizontal by setting the independent variable withXYLinemap.function_dependency: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', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() lmap = plot.linemap(0) lmap.line.line_thickness = 0.8 lmap.line.color = Color.DeepRed lmap.y_axis.title.color = Color.DeepRed lmap = plot.linemap(1) lmap.show = True lmap.y_axis_index = 1 lmap.line.line_thickness = 0.8 lmap.line.color = Color.Blue lmap.y_axis.title.color = lmap.line.color tp.export.save_png('linemap_xy.png', 600, supersample=3)
Attributes
aux_dataAuxiliary data for this linemap. barsLinemapBarsstyle for bar charts.curveLinemapCurvestyle and fitting-method control for lines.error_barsLinemapErrorBarsstyle for error bars.function_dependencyThe independent variable for function evalulation. indexZero-based integer identifier for this Linemaps. indicesLinemapIndicesobject controlling which lines are shown.lineLinemapLinestyle for lines to be drawn.nameName identifier of this Linemaps. showDisplay this linemap on the plot. show_in_legendShow this Linemaps in the legend. sort_modeMode controlling which Variableto use when sorting lines.sort_variableSpecific Variableused when listing lines.sort_variable_indexZero-based index of the specific Variableused for sorting.symbolsLinemapSymbolsstyle for markers at points along the lines.x_axisThe X-axis used by this linemap. x_axis_indexZero-based index of the x-axis used by this linemap. x_variableVariableused for x-positions of this linemap.x_variable_indexZero-based index of the Variableused for x-positions.y_axisY-axis used by this linemap. y_axis_indexZero-based index of the y-axis used by this linemap. y_variableVariableused for y-positions of this linemap.y_variable_indexZero-based index of the Variableused for y-positions.zoneData source (Zone) for this Linemaps. zone_indexZero-based index of the Zone this Linemaps will draw.
-
XYLinemap.aux_data¶ Auxiliary data for this linemap.
Returns:
AuxDataThis is the auxiliary data attached to the linemap. Such data is written to the layout file by default and can be retrieved later. Example usage:
>>> from tecplot.constant import PlotType >>> plot = tp.active_frame().plot(PlotType.XYLine) >>> aux = plot.linemap(0).aux_data >>> aux['Result'] = '3.14159' >>> print(aux['Result']) 3.14159
-
XYLinemap.bars¶ LinemapBarsstyle for bar charts.Type: LinemapBars
-
XYLinemap.curve¶ LinemapCurvestyle and fitting-method control for lines.Type: LinemapCurve
-
XYLinemap.error_bars¶ LinemapErrorBarsstyle for error bars.Type: LinemapErrorBars
-
XYLinemap.function_dependency¶ The independent variable for function evalulation.
Possible values:
XIndependent,YIndependent.Example usage:
>>> from tecplot.constant import FunctionDependency >>> lmap = plot.linemap(0) >>> lmap.function_dependency = FunctionDependency.YIndependent
Type: FunctionDependency
-
XYLinemap.index¶ Zero-based integer identifier for this Linemaps.
Example:
>>> lmap = plot.linemap(1) >>> print(lmap.index) 1
Type: int
-
XYLinemap.indices¶ LinemapIndicesobject controlling which lines are shown.Type: LinemapIndices
-
XYLinemap.line¶ LinemapLinestyle for lines to be drawn.Type: LinemapLine
-
XYLinemap.name¶ Name identifier of this Linemaps.
Names are automatically assigned to each mapping. The nature of the name depends on the type of data used to create the mapping. If your data has only one dependent variable, the default is to use the zone name for the mapping. If your data has multiple dependent variables, then the default is to use the dependent variable name for the mapping. In either case each mapping is assigned a special name (
&ZN&or&DN&) that is replaced with the zone or variable name when the name is displayed.Selecting variables in a 3D finite element zone may require significant time, since the variable must be loaded over the entire zone. XY and Polar line plots are best used with linear or ordered data, or with two-dimensional finite element data.
Certain placeholder text will be replaced with values based on elements within the plot. By combining static text with these placeholders, you can construct a name in any format you like:
>>> plot.linemap(2).name = 'Zone: &ZN&'
The placeholders available are:
- Zone name (
&ZN&) - This will be replaced with the actual name of the zone assigned to that mapping.
- Zone number (
&Z#&) - This will be replaced with the actual number of the zone assigned to the mapping.
- Independent variable name (
&IV&) - This will be replaced with the actual name of the independent variable assigned to that mapping.
- Independent variable number (
&I#&) - This will be replaced with the actual number of the independent variable assigned to the mapping.
- Dependent variable name (
&DV&) - This will be replaced with the actual name of the dependent variable assigned to that mapping.
- Dependent variable number (
&D#&) - This will be replaced with the actual number of the dependent variable assigned to the mapping.
- Map number (
&M#&) - This will be replaced with the actual number of the mapping.
- X-Axis number (
&X#&) - This will be replaced with the actual number of the X-axis assigned to that mapping for XY Line plots. This option is not available for Polar Line plots.
- Y-Axis number (
&Y#&) - This will be replaced with the actual number of the Y-axis assigned to that mapping for XY Line plots. This option is not available for Polar Line plots.
Type: str- Zone name (
-
XYLinemap.show¶ Display this linemap on the plot.
Example usage for turning on all linemaps:
>>> for lmap in plot.linemaps(): ... lmap.show = True
Type: bool
-
XYLinemap.show_in_legend¶ Show this Linemaps in the legend.
Possible values:
LegendShow.Always- The mapping appears in the legend even if the mapping is turned off (deactivated) or its entry in the table looks exactly like another mapping’s entry.
LegendShow.Never- The mapping never appears in the legend.
LegendShow.Auto(default)- The mapping appears in the legend only when the mapping is turned on. If two mappings would result in the same entry in the legend, only one entry is shown.
Type: LegendShow
-
XYLinemap.sort_mode¶ Mode controlling which
Variableto use when sorting lines.Possible values:
LineMapSort.BySpecificVar,LineMapSort.ByIndependentVar,LineMapSort.ByDependentVarorLineMapSort.None_.Example usage:
>>> from tecplot.constant import LineMapSort >>> plot.linemap(0).sort_mode = LineMapSort.ByDependentVar
Type: LineMapSort
-
XYLinemap.sort_variable¶ Specific
Variableused when listing lines.The
sort_modeattribute must be set toLineMapSort.BySpecificVar:>>> from tecplot.constant import LineMapSort >>> plot.linemap(0).sort_by = LineMapSort.BySpecificVar >>> plot.linemap(0).sort_variable = dataset.variable('P')
Type: Variable
-
XYLinemap.sort_variable_index¶ Zero-based index of the specific
Variableused for sorting.The
sort_modeattribute must be set toLineMapSort.BySpecificVar:>>> from tecplot.constant import LineMapSort >>> plot.linemap(0).sort_by = LineMapSort.BySpecificVar >>> plot.linemap(0).sort_variable_index = 3
Type: int
-
XYLinemap.symbols¶ LinemapSymbolsstyle for markers at points along the lines.Type: LinemapSymbols
-
XYLinemap.x_axis¶ The X-axis used by this linemap.
Example usage:
>>> plot.linemap(0).x_axis = plot.axes.x_axis(2)
Type: XYLineAxis
-
XYLinemap.x_axis_index¶ Zero-based index of the x-axis used by this linemap.
Example usage:
>>> plot.linemap(0).x_axis_index = 2
Type: int
-
XYLinemap.x_variable¶ Variableused for x-positions of this linemap.Example usage:
>>> plot.linemap(0).x_variable = dataset.variable('P')
Type: Variable
-
XYLinemap.x_variable_index¶ Zero-based index of the
Variableused for x-positions.Example usage:
>>> plot.linemap(0).x_variable_index = 2
Type: int
-
XYLinemap.y_axis¶ Y-axis used by this linemap.
Example usage:
>>> plot.linemap(0).x_axis = plot.axes.y_axis(2)
Type: XYLineAxis
-
XYLinemap.y_axis_index¶ Zero-based index of the y-axis used by this linemap.
Example usage:
>>> plot.linemap(0).y_axis_index = 2
Type: int
-
XYLinemap.y_variable¶ Variableused for y-positions of this linemap.Example usage:
>>> plot.linemap(0).y_variable = dataset.variable('Q')
Type: Variable
-
XYLinemap.y_variable_index¶ Zero-based index of the
Variableused for y-positions.Example usage:
>>> plot.linemap(0).y_variable_index = 2
Type: int
LinemapLine¶
-
class
tecplot.plot.LinemapLine(linemap)[source]¶ Style control for the line to be drawn.
This controls the style of the lines plotted for a given
XYLinemap:from os import path import tecplot as tp from tecplot.constant import PlotType, Color, LinePattern examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() lmap = plot.linemap(0) line = lmap.line line.color = Color.Blue line.line_thickness = 1 line.line_pattern = LinePattern.LongDash line.pattern_length = 2 tp.export.save_png('linemap_line.png', 600, supersample=3)
Attributes
colorColorof the line to be drawn.line_patternPattern style of the line to be drawn. line_thicknessWidth of the line to be drawn. pattern_lengthSegment length of the repeated line pattern. showDisplay this point-to-point line on the plot.
-
LinemapLine.color¶ Colorof the line to be drawn.Example usage:
>>> from tecplot.constant import Color >>> plot.linemap(0).line.color = Color.Blue
Type: Color
-
LinemapLine.line_pattern¶ Pattern style of the line to be drawn.
Possible values:
Solid,Dashed,DashDot,Dotted,LongDash,DashDotDot.Example usage:
>>> from tecplot.constant import LinePattern >>> lmap = plot.linemap(0) >>> lmap.line.line_pattern = LinePattern.LongDash
Type: LinePattern
-
LinemapLine.line_thickness¶ Width of the line to be drawn.
Example usage:
>>> plot.linemap(0).line.line_thickness = 0.5
Type: float
LinemapCurve¶
-
class
tecplot.plot.LinemapCurve(linemap)[source]¶ Curve-fitting of the line.
This class controls how the line is to be drawn between data points. By default, the
CurveType.LineSegoption is used and straight lines are used. Settingcurve_typeto a fit type or spline type will replace the line segments with a smooth curve:import numpy as np from os import path import tecplot as tp from tecplot.constant import PlotType, CurveType examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) dataset.add_variable('Weight') # convert error to weighting to be used for fitting below # This converts the error to (1 / error) # and normalizes to the range [1,100] zone = dataset.zone('ZONE 1') err1 = zone.values('Error 1') wvar = zone.values('Weight') err = err1.as_numpy_array() sigma = 1. / err dsigma = sigma.max() - sigma.min() sigma = (99 * (sigma - sigma.min()) / dsigma) + 1 wvar[:] = sigma frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() xvar = dataset.variable(0) for lmap,var in zip(plot.linemaps(),list(dataset.variables())[1:4]): lmap.x_variable = xvar lmap.y_variable = var lmap.show = True curves = [lmap.curve for lmap in plot.linemaps()] curves[0].curve_type = CurveType.PolynomialFit curves[0].num_points = 1000 curves[0].polynomial_order = 10 curves[1].curve_type = CurveType.PowerFit curves[1].use_fit_range = True curves[1].fit_range = 4,8 curves[1].weight_variable = dataset.variable('Weight') curves[1].use_weight_variable = True curves[2].curve_type = CurveType.Spline curves[2].clamp_spline = True curves[2].spline_derivative_at_ends = 0,0 tp.export.save_png('linemap_curve.png', 600, supersample=3)
Attributes
clamp_splineEnable derivative clamping for spline fits. curve_typeType of curve to draw or fit. fit_rangeThe range to fit and display a fitted curve. num_pointsNumber of points to use when drawing a fitted curve. polynomial_orderOrder of the fit when set to polynomial. spline_derivative_at_endsClamp the derivative of the spline fit at the edges of the range. use_fit_rangeLimit the fit to the fit_rangespecified.use_weight_variableUse the specified variable for curve-fit weighting. weight_variableVariable to use for curve-fit weighting. weight_variable_indexZero-based index of the variable to use for curve-fit weighting.
-
LinemapCurve.clamp_spline¶ Enable derivative clamping for spline fits.
Example showing how to set the derivative at the limits of a spline curve to zero:
>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.Spline >>> curve.clamp_spline = True >>> curve.spline_derivative_at_ends = 0, 0
Type: bool
-
LinemapCurve.curve_type¶ Type of curve to draw or fit.
Possible values:
LineSeg,PolynomialFit,EToRFit,PowerFit,Spline,ParaSpline.CurveType.LineSeg(line segment, no curve-fit)- A series of linear segments connect adjacent data points. In XY Line plots, these will be line segments.
CurveType.PolynomialFit- A polynomial of order
LinemapCurve.polynomial_orderis fit to the data points where \(1 <= N <= 10\). \(N = 1\) is a straight-line fit. CurveType.EToRFit(exponential curve-fit)- An exponential curve-fit that finds the best curve of the form \(Y = e^{b\cdot X+c}\) which is equivalent to \(Y = a\cdot e^{b\cdot X}\), where \(a = e^c\). To use this curve type, Y-values for this variable must be all positive or all negative. If the function dependency is set to \(X = f(Y)\) all X-values must be all positive or all negative.
CurveType.PowerFit- A power curve fit that finds the best curve of the form \(Y = e^{b \cdot \ln X + c}\) which is equivalent to \(Y = a\cdot X^b\) , where \(a = e^c\). To use this curve type, Y-values for this variable must be all positive or all negative; X-values must be all positive. If the function dependency is set to \(X = f(Y)\), X-values must be all positive or all negative, and the Y-values must all be positive.
CurveType.Spline- A smooth curve is generated that goes through every point. The spline is drawn through the data points after sorting the points into increasing values of the independent variable, resulting in a single-valued function of the independent variable. The spline may be clamped or free. With a clamped spline, you supply the derivative of the function at each end point; with a non-clamped (natural or free) spline, these derivatives are determined for you. In xy-line plots, specifying the derivative gives you control over the initial and final slopes of the curve.
CurveType.ParaSpline(parametric spline)- Creates a smooth curve as with a spline, except the assumption is
that both variables are functions of the index of the data points.
For example in xy-line plot,
ParaSplinefits \(x = f(i)\) and \(y=g(i)\) where \(f()\) and \(g()\) are both smooth. No additional sorting of the points is performed. This spline may result in a multi-valued function of either or both axis variables.
Example usage:
>>> from tecplot.constant import CurveType >>> plot.linemap(0).curve.curve_type = CurveType.PolynomialFit
Type: CurveType
-
LinemapCurve.fit_range¶ The range to fit and display a fitted curve.
Example showing how to set the limits of a polynomial fit to [5,10]. The
use_fit_rangeattribute must be set toTrue:>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.PolynomialFit >>> curve.use_fit_range = True >>> curve.fit_range = 5, 10
Type: tuple
-
LinemapCurve.num_points¶ Number of points to use when drawing a fitted curve.
Example usage:
>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.PolynomialFit >>> curve.num_points = 100
Type: int
-
LinemapCurve.polynomial_order¶ Order of the fit when set to polynomial.
A value of 1 will fit the data to a straight line. Example usage:
>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.PolynomialFit >>> curve.polynomial_order = 4
Type: int(1 to 10)
-
LinemapCurve.spline_derivative_at_ends¶ Clamp the derivative of the spline fit at the edges of the range.
Example showing how to set the derivative at the limits of a spline curve to zero. Notice the
clamp_splineattribute must be set toTrue:>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.Spline >>> curve.clamp_spline = True >>> curve.spline_derivative_at_ends = 0, 0
Type: tuple
-
LinemapCurve.use_fit_range¶ Limit the fit to the
fit_rangespecified.Example usage:
>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.PolynomialFit >>> curve.use_fit_range = True >>> curve.fit_range = 5, 10
Type: bool
-
LinemapCurve.use_weight_variable¶ Use the specified variable for curve-fit weighting.
Example usage:
>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.PolynomialFit >>> curve.use_weight_variable = True >>> curve.weight_variable_index = 3
Type: bool
-
LinemapCurve.weight_variable¶ Variable to use for curve-fit weighting.
Example usage:
>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.PolynomialFit >>> curve.use_weight_variable = True >>> curve.weight_variable = dataset.variable('P')
Type: Variable
-
LinemapCurve.weight_variable_index¶ Zero-based index of the variable to use for curve-fit weighting.
The
use_weight_variableattribute must be set toTrue:>>> from tecplot.constant import CurveType >>> curve = plot.linemap(0).curve >>> curve.curve_type = CurveType.PolynomialFit >>> curve.use_weight_variable = True >>> curve.weight_variable_index = 3
Type: int
LinemapBars¶
-
class
tecplot.plot.LinemapBars(linemap)[source]¶ Bar chart style control.
A bar chart is an XY Line plot that uses vertical or horizontal bars placed along an axis to represent data points. Changing the function dependency of the linemap with
XYLinemap.function_dependencycontrols the direction of the bars. By default, all mappings use \(y = f(x)\) and appear as vertical bar charts. Setting y to be the independent variable will cause the bars to be horizontal: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', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() plot.show_bars = True lmap = plot.linemap(0) bars = lmap.bars bars.show = True bars.size = 0.6*(100 / dataset.zone(0).num_points) bars.fill_color = Color.Red bars.line_color = Color.Red bars.line_thickness = 0.01 tp.export.save_png('linemap_bars.png', 600, supersample=3)
Attributes
fill_colorFill color of the bars. fill_modefill mode for the bars. line_colorEdge line color of the bars. line_thicknessEdge line thickness of the bars. showDisplay bars on the plot for this Linemaps. sizeWidth of the bars.
-
LinemapBars.fill_color¶ Fill color of the bars.
The
fill_modeattribute must be set toFillMode.UseSpecificColor:>>> from tecplot.constant import Color, FillMode >>> bars = plot.linemap(0).bars >>> bars.fill_mode = FillMode.UseSpecificColor >>> bars.fill_color = Color.Red
Type: ColororContourGroup.
-
LinemapBars.fill_mode¶ fill mode for the bars.
- Possible values:
FillMode.UseSpecificColor,FillMode.UseLineColor, FillMode.UseBackgroundColororFillMode.None_.
Example usage:
>>> from tecplot.constant import FillMode >>> bars = plot.linemap(0).bars >>> bars.fill_mode = FillMode.UseBackgroundColor
Type: FillMode- Possible values:
-
LinemapBars.line_color¶ Edge line color of the bars.
Example usage:
>>> from tecplot.constant import Color >>> plot.linemap(0).bars.line_color = Color.Red
Type: Color
-
LinemapBars.line_thickness¶ Edge line thickness of the bars.
Example usage:
>>> plot.linemap(0).bars.line_thickness = 0.1
Type: float
LinemapErrorBars¶
-
class
tecplot.plot.LinemapErrorBars(linemap)[source]¶ Error bar style and variable assignment control.
A single
XYLinemapholds a singleVariableassignment for error bars. Therefore, if you wish to have separate error bars for x and y, two linemaps are required:from math import sqrt from os import path import tecplot as tp from tecplot.constant import PlotType, Color, ErrorBar # setup dataset frame = tp.active_frame() ds = frame.create_dataset('Dataset') for v in ['x', 'y', 'xerr', 'yerr']: ds.add_variable(v) zone = ds.add_ordered_zone('Zone', 5) # create some data (x, y) zone.values('x')[:] = [0,1,2,3,4] zone.values('y')[:] = [1,2,4,8,10] # error in x is a constant zone.values('xerr')[:] = [0.2]*5 # error in y is the square-root of the value zone.values('yerr')[:] = [sqrt(y) for y in zone.values('y')[:]] frame.plot_type = PlotType.XYLine plot = frame.plot() plot.delete_linemaps() xerr_lmap = plot.add_linemap('xerr', zone, ds.variable('x'), ds.variable('y')) yerr_lmap = plot.add_linemap('yerr', zone, ds.variable('x'), ds.variable('y')) xerr_lmap.error_bars.variable = ds.variable('xerr') xerr_lmap.error_bars.bar_type = ErrorBar.Horz xerr_lmap.error_bars.color = Color.Blue xerr_lmap.error_bars.line_thickness = 0.8 xerr_lmap.error_bars.show = True yerr_lmap.error_bars.variable = ds.variable('yerr') yerr_lmap.error_bars.bar_type = ErrorBar.Vert yerr_lmap.error_bars.color = Color.Blue yerr_lmap.error_bars.line_thickness = 0.8 yerr_lmap.error_bars.show = True plot.show_lines = False plot.show_error_bars = True plot.view.fit() tp.export.save_png('linemap_error_bars.png', 600, supersample=3)
Attributes
bar_typeStyle of the error bar to draw. colorColorof the error bars.endcap_sizeLength of the endcaps of the error bars. line_thicknessWidth of the error bar lines. showDisplay error bars on the plot for this Linemaps. stepSpace between points to show error bars. step_modeSpace the error bars by index or frame height. variableVariableto use for error bar sizes.variable_indexZero-based variable index to use for error bar sizes.
-
LinemapErrorBars.bar_type¶ Style of the error bar to draw.
Possible values:
Up,Down,Left,Right,Horz,Vert,Cross.Example usage:
>>> from tecplot.constant import ErrorBar >>> plot.linemap(0).error_bars.bar_type = ErrorBar.Cross
Type: ErrorBar
-
LinemapErrorBars.color¶ Colorof the error bars.Example usage:
>>> from tecplot.constant import Color >>> plot.linemap(0).error_bars.color = Color.Red
Type: Color
-
LinemapErrorBars.endcap_size¶ Length of the endcaps of the error bars.
Example usage:
>>> plot.linemap(0).error_bars.endcap_size = 2.5
Type: float
-
LinemapErrorBars.line_thickness¶ Width of the error bar lines.
Example usage:
>>> plot.linemap(0).error_bars.line_thickness = 0.8
Type: float
-
LinemapErrorBars.show¶ Display error bars on the plot for this Linemaps.
The parent plot object must have error bars enables as well which will require a variable to be set:
>>> plot.linemap(0).error_bars.variable = dataset.variable('E') >>> plot.show_error_bars = True >>> plot.linemap(0).error_bars.show = True
Type: bool
-
LinemapErrorBars.step¶ Space between points to show error bars.
The step is specified either as a percentage of the frame height or as a number of indices to skip depending on the value of
LinemapErrorBars.step_mode. This example will add error bars to every third point:>>> plot.linemap(0).error_bars.step = 3
Type: float
-
LinemapErrorBars.step_mode¶ Space the error bars by index or frame height.
This example will make sure all error bars are no closer than 10% of the frame height to each other:
>>> from tecplot.constant import StepMode >>> ebars = plot.linemap(0).error_bars >>> ebars.step_mode = StepMode.ByFrameUnits >>> ebars.step = 10
Type: StepMode
LinemapIndices¶
-
class
tecplot.plot.LinemapIndices(linemap)[source]¶ Ordering and spacing of points to be drawn.
Each mapping can show either I, J, or K-varying families of lines. By default, the I-varying family of lines are displayed. You can also choose which members of the family are drawn (and using which data points), by specifying index ranges for each of I, J, and K. The index range for the varying index says which points to include in each line, and the index ranges for the other indices determine which lines in the family to include:
from os import path import tecplot as tp from tecplot.constant import PlotType, IJKLines examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() for lmap in list(plot.linemaps())[:3]: lmap.show = True lmap.indices.varying_index = IJKLines.I lmap.indices.i_range = 0,0,3 # save image to file tp.export.save_png('linemap_indices.png', 600, supersample=3)
Attributes
i_rangeIndexRangefor the I dimension of ordered data.j_rangeIndexRangefor the J dimension of ordered data.k_rangeIndexRangefor the K dimension of ordered data.varying_indexFamily of lines to be drawn.
-
LinemapIndices.i_range¶ IndexRangefor the I dimension of ordered data.This example shows
I-lines ati = [0, 2, 4, 6, 8, 10]:>>> plot.linemap(0).indices.i_range = 0, 10, 2
Type: tupleofintegers(min, max, step)
-
LinemapIndices.j_range¶ IndexRangefor the J dimension of ordered data.This example shows all
J-lines starting withj = 10up to the maximumJ-line of the associated Zone:>>> plot.linemap(0).indices.j_range = 10, None, 1
Type: tupleofintegers(min, max, step)
-
LinemapIndices.k_range¶ IndexRangefor the K dimension of ordered data.This example shows all
K-lines starting with the first up to 5 from the lastK-line of the associated Zone:>>> plot.linemap(0).indices.k_range = None, -5
Type: tupleofintegers(min, max, step)
LinemapSymbols¶
-
class
tecplot.plot.LinemapSymbols(linemap)[source]¶ Style control for markers placed along lines.
This class allows the user to set the style of the symbols to be shown including setting a geometric shape, text character, line and fill colors and spacing. The plot-level
show_symbolsattribute must be enabled to show symbols in any specific linemap within the plot:from os import path import tecplot as tp from tecplot.constant import PlotType, Color, FillMode, GeomShape examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() plot.show_symbols = True for lmap in list(plot.linemaps())[:3]: lmap.symbols.show = True lmap.symbols.symbol().shape = GeomShape.Square lmap.symbols.size = 2.5 lmap.symbols.color = Color.Blue lmap.symbols.line_thickness = 0.4 lmap.symbols.fill_mode = FillMode.UseSpecificColor lmap.symbols.fill_color = Color.Azure # save image to file tp.export.save_png('linemap_symbols.png', 600, supersample=3)
Attributes
colorEdge or text Colorof the drawn symbols.fill_colorThe fill or background color. fill_modeThe fill mode for the background. line_thicknessWidth of the lines when drawing geometry symbols. showDisplay symbols along the lines to be drawn. sizeSize of the symbols to draw. stepSpace between symbols to be shown. step_modeSpace the symbols by index or frame height. symbol_typeThe SymbolTypeto use for this linemap.Methods
symbol([symbol_type])Returns a linemap symbol style object.
-
LinemapSymbols.color¶ Edge or text
Colorof the drawn symbols.Example usage:
>>> from tecplot.constant import Color >>> plot.linemap(1).symbols.color = Color.Blue
Type: Color
-
LinemapSymbols.fill_color¶ The fill or background color.
The
fill_modeattribute must be set toFillMode.UseSpecificColor:>>> from tecplot.constant import Color, FillMode >>> symbols = plot.linemap(0).symbols >>> symbols.fill_mode = FillMode.UseSpecificColor >>> symbols.fill_color = Color.Yellow
Type: Color
-
LinemapSymbols.fill_mode¶ The fill mode for the background.
- Possible values:
FillMode.UseSpecificColor,FillMode.UseLineColor, FillMode.UseBackgroundColororFillMode.None_.
Example usage:
>>> from tecplot.constant import Color, FillMode >>> symbols = plot.linemap(0).symbols >>> symbols.fill_mode = FillMode.UseBackgroundColor
Type: FillMode- Possible values:
-
LinemapSymbols.line_thickness¶ Width of the lines when drawing geometry symbols.
Example usage:
>>> from tecplot.constant import SymbolType >>> symbols = plot.linemap(0).symbols >>> symbols.symbol_type = SymbolType.Geometry >>> symbols.line_thickness = 0.8
Type: float
-
LinemapSymbols.show¶ Display symbols along the lines to be drawn.
The parent plot object must have symbols enabled as well:
>>> plot.show_symbols = True >>> plot.linemap(0).symbols.show = True
Type: bool
-
LinemapSymbols.size¶ Size of the symbols to draw.
Example usage:
>>> plot.linemap(0).symbols.size = 3.5
Type: float
-
LinemapSymbols.step¶ Space between symbols to be shown.
The step is specified either as a percentage of the frame height or as a number of indices to skip depending on the value of
LinemapSymbols.step_mode. This example will add symbols to every third point:>>> plot.linemap(0).symbols.step = 3
Type: float
-
LinemapSymbols.step_mode¶ Space the symbols by index or frame height.
This example will make sure all symbols are no closer than 10% of the frame height to each other:
>>> from tecplot.constant import StepMode >>> sym = plot.linemap(0).symbols >>> sym.step_mode = StepMode.ByFrameUnits >>> sym.step = 10
Type: StepMode
-
LinemapSymbols.symbol(symbol_type=None)[source]¶ Returns a linemap symbol style object.
Parameters: symbol_type ( SymbolType, optional) – The type of symbol to return. By default, this will return the active symbol type which is obtained fromLinemapSymbols.symbol_type.Returns:
TextSymbolorGeometrySymbolExample usage:
>>> from tecplot.constant import SymbolType >>> plot.linemap(0).symbols.symbol_type = SymbolType.Text >>> symbol = plot.linemap(0).symbols.symbol() >>> symbol.text = 'a'
-
LinemapSymbols.symbol_type¶ The
SymbolTypeto use for this linemap.Possible values are:
SymbolType.Geometry,SymbolType.Text.This sets the active symbol type. Use LinemapSymbols.symbol` to access the symbol:
>>> from tecplot.constant import SymbolType >>> linemap = plot.linemap(0) >>> linemap.symbols.symbol_type = SymbolType.Text >>> symbol = linemap.symbols.symbol(SymbolType.Text) >>> symbol.text = 'a'
Type: SymbolType
GeometrySymbol¶
-
class
tecplot.plot.GeometrySymbol(parent, svarg='SYMBOLSHAPE')[source]¶ Geometric shape for linemap symbols.
from os import path import tecplot as tp from tecplot.constant import (PlotType, Color, GeomShape, SymbolType, FillMode) examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() plot.show_symbols = True cols = [Color.DeepRed, Color.Blue, Color.Fern] shapes = [GeomShape.Square, GeomShape.Circle, GeomShape.Del] for lmap,color,shape in zip(plot.linemaps(), cols, shapes): lmap.show = True lmap.line.color = color symbols = lmap.symbols symbols.show = True symbols.size = 4.5 symbols.color = color symbols.fill_mode = FillMode.UseSpecificColor symbols.fill_color = color symbols.symbol_type = SymbolType.Geometry symbols.symbol().shape = shape plot.view.fit() # save image to file tp.export.save_png('linemap_symbols_geometry.png', 600, supersample=3)
Attributes
shapeGeometric shape to use when plotting linemap symbols.
-
GeometrySymbol.shape¶ Geometric shape to use when plotting linemap symbols.
Possible values:
Square,Del,Grad,RTri,LTri,Diamond,Circle,Cube,Sphere,Octahedron,Point.Example usage:
>>> from tecplot.constant import SymbolType, GeomShape >>> symbols = plot.linemap(0).symbols >>> symbols.symbol_type = SymbolType.Geometry >>> symbols.symbol().shape = GeomShape.Diamond
Type: GeomShape
TextSymbol¶
-
class
tecplot.plot.TextSymbol(parent, svarg='SYMBOLSHAPE')[source]¶ Text character for linemap symbols.
Only a single character can be used.
from os import path import tecplot as tp from tecplot.constant import PlotType, Color, SymbolType, FillMode examples_dir = tp.session.tecplot_examples_directory() infile = path.join(examples_dir, 'SimpleData', 'Rainfall.dat') dataset = tp.data.load_tecplot(infile) frame = tp.active_frame() frame.plot_type = PlotType.XYLine plot = frame.plot() plot.show_symbols = True cols = [Color.DeepRed, Color.Blue, Color.Fern] chars = ['S','D','M'] for lmap,color,character in zip(plot.linemaps(), cols, chars): lmap.show = True lmap.line.color = color syms = lmap.symbols syms.show = True syms.symbol_type = SymbolType.Text syms.size = 2.5 syms.color = Color.White syms.fill_mode = FillMode.UseSpecificColor syms.fill_color = color syms.symbol().text = character plot.view.fit() # save image to file tp.export.save_png('linemap_symbols_text.png', 600, supersample=3)
Attributes
font_overrideTypeface to use when rendering text-based symbols. textThe ASCII character to use as the symbol to show use_base_fontUse the base typeface when rendering text-based symbols.
-
TextSymbol.font_override¶ Typeface to use when rendering text-based symbols.
Possible values:
constant.Font.Greek,constant.Font.Mathorconstant.Font.UserDefined.The
use_base_fontattribute must be set toFalse:>>> from tecplot.constant import SymbolType, Font >>> symbols = plot.linemap(0).symbols >>> symbols.symbol_type = SymbolType.Text >>> symbols.symbol().use_base_font = False >>> symbols.symbol().font_override = Font.Greek
Type: constant.Font
-
TextSymbol.text¶ The ASCII character to use as the symbol to show
Note
This is limited to a single character.
Example usage:
>>> from tecplot.constant import SymbolType >>> symbols = plot.linemap(0).symbols >>> symbols.symbol_type = SymbolType.Text >>> symbols.symbol().text = 'X'
-
TextSymbol.use_base_font¶ Use the base typeface when rendering text-based symbols.
When
False, thefont_overrideattribute takes effect:>>> from tecplot.constant import SymbolType, Font >>> symbols = plot.linemap(0).symbols >>> symbols.symbol_type = SymbolType.Text >>> symbols.symbol().use_base_font = False >>> symbols.symbol().font_override = Font.Greek
Type: bool

























