pytecplot 1.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytecplot-1.5.2.dist-info/LICENSE.html +77 -0
- pytecplot-1.5.2.dist-info/METADATA +508 -0
- pytecplot-1.5.2.dist-info/RECORD +97 -0
- pytecplot-1.5.2.dist-info/WHEEL +5 -0
- pytecplot-1.5.2.dist-info/top_level.txt +1 -0
- tecplot/__init__.py +94 -0
- tecplot/annotation/__init__.py +7 -0
- tecplot/annotation/annotation.py +223 -0
- tecplot/annotation/geometry.py +369 -0
- tecplot/annotation/georeference.py +33 -0
- tecplot/annotation/image.py +185 -0
- tecplot/annotation/iter.py +105 -0
- tecplot/annotation/polyline.py +381 -0
- tecplot/annotation/text.py +744 -0
- tecplot/constant.py +401 -0
- tecplot/data/__init__.py +34 -0
- tecplot/data/array.py +645 -0
- tecplot/data/create.py +1 -0
- tecplot/data/dataset.py +1809 -0
- tecplot/data/extract.py +544 -0
- tecplot/data/face_neighbors.py +494 -0
- tecplot/data/facemap.py +814 -0
- tecplot/data/load.py +2075 -0
- tecplot/data/nodemap.py +577 -0
- tecplot/data/operate.py +928 -0
- tecplot/data/query.py +334 -0
- tecplot/data/save.py +343 -0
- tecplot/data/variable.py +280 -0
- tecplot/data/zone.py +841 -0
- tecplot/exception.py +201 -0
- tecplot/export/__init__.py +13 -0
- tecplot/export/animation.py +521 -0
- tecplot/export/export_setup.py +318 -0
- tecplot/export/image.py +577 -0
- tecplot/export/print_setup.py +218 -0
- tecplot/export/time_animation.py +607 -0
- tecplot/extension/__init__.py +14 -0
- tecplot/extension/ipython.py +68 -0
- tecplot/layout/__init__.py +20 -0
- tecplot/layout/frame.py +1285 -0
- tecplot/layout/layout.py +488 -0
- tecplot/layout/page.py +541 -0
- tecplot/legend/__init__.py +4 -0
- tecplot/legend/contour_legend.py +516 -0
- tecplot/legend/legend.py +141 -0
- tecplot/legend/line_legend.py +66 -0
- tecplot/legend/rgb_coloring_legend.py +291 -0
- tecplot/legend/scatter_legend.py +136 -0
- tecplot/macro.py +339 -0
- tecplot/plot/__init__.py +62 -0
- tecplot/plot/axes.py +881 -0
- tecplot/plot/axis.py +1350 -0
- tecplot/plot/blanking.py +584 -0
- tecplot/plot/contour.py +1302 -0
- tecplot/plot/effects.py +162 -0
- tecplot/plot/fieldmap.py +2159 -0
- tecplot/plot/grid.py +758 -0
- tecplot/plot/isosurface.py +1167 -0
- tecplot/plot/labels.py +338 -0
- tecplot/plot/linemap.py +1905 -0
- tecplot/plot/linking.py +489 -0
- tecplot/plot/plot.py +1791 -0
- tecplot/plot/rgb_coloring.py +281 -0
- tecplot/plot/scatter.py +396 -0
- tecplot/plot/slice.py +1544 -0
- tecplot/plot/streamtrace.py +1949 -0
- tecplot/plot/symbol.py +567 -0
- tecplot/plot/ticks.py +666 -0
- tecplot/plot/title.py +380 -0
- tecplot/plot/vector.py +679 -0
- tecplot/plot/view.py +868 -0
- tecplot/session/__init__.py +112 -0
- tecplot/session/aux_data.py +276 -0
- tecplot/session/config.py +92 -0
- tecplot/session/session.py +425 -0
- tecplot/session/state_changed.py +225 -0
- tecplot/session/style.py +504 -0
- tecplot/tecutil/__init__.py +16 -0
- tecplot/tecutil/arglist.py +230 -0
- tecplot/tecutil/captured_output.py +177 -0
- tecplot/tecutil/constant.py +1312 -0
- tecplot/tecutil/index_set.py +118 -0
- tecplot/tecutil/lock.py +36 -0
- tecplot/tecutil/message_pb2.py +39 -0
- tecplot/tecutil/preamble.py +54 -0
- tecplot/tecutil/stringlist.py +114 -0
- tecplot/tecutil/sv.py +1662 -0
- tecplot/tecutil/tecutil.py +12402 -0
- tecplot/tecutil/tecutil_client.py +627 -0
- tecplot/tecutil/tecutil_connector.py +937 -0
- tecplot/tecutil/tecutil_rpc.py +6845 -0
- tecplot/tecutil/util.py +332 -0
- tecplot/text/__init__.py +3 -0
- tecplot/text/font.py +224 -0
- tecplot/text/label_format.py +374 -0
- tecplot/text/textbox.py +106 -0
- tecplot/version.py +41 -0
tecplot/plot/linking.py
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
from builtins import int, super
|
|
2
|
+
|
|
3
|
+
from ..exception import *
|
|
4
|
+
from ..tecutil import sv
|
|
5
|
+
from .. import session
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SketchPlotLinkingBetweenFrames(session.Style):
|
|
9
|
+
"""`SketchPlot` `Frame <layout.Frame>` style linking control.
|
|
10
|
+
|
|
11
|
+
.. seealso:: `Cartesian3DPlotLinkingBetweenFrames` for details on how to
|
|
12
|
+
link style across multiple frames.
|
|
13
|
+
"""
|
|
14
|
+
def __init__(self, frame):
|
|
15
|
+
self.frame = frame
|
|
16
|
+
super().__init__(sv.LINKING, sv.BETWEENFRAMES, uniqueid=frame.uid)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def group(self):
|
|
20
|
+
"""`int`: Group number (1-32).
|
|
21
|
+
|
|
22
|
+
Each frame may be a member of a single group and may opt in or out of
|
|
23
|
+
linking each specific style to other frames within this group. Once the
|
|
24
|
+
group is set, the frame may opt in and out of specific attributes::
|
|
25
|
+
|
|
26
|
+
>>> frame_linking = plot.linking_between_frames
|
|
27
|
+
>>> frame_linking.group = 5
|
|
28
|
+
>>> frame_linking.link_frame_size_and_position = True
|
|
29
|
+
>>> frame_linking.link_solution_time = True
|
|
30
|
+
"""
|
|
31
|
+
return self._get_style(int, sv.LINKGROUP)
|
|
32
|
+
|
|
33
|
+
@group.setter
|
|
34
|
+
def group(self, value):
|
|
35
|
+
self._set_style(int(value), sv.LINKGROUP)
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def link_frame_size_and_position(self):
|
|
39
|
+
"""`bool`: Match frame geometry.
|
|
40
|
+
|
|
41
|
+
Keeps the same geometry across all frames in the specified `group`.
|
|
42
|
+
Example usage::
|
|
43
|
+
|
|
44
|
+
>>> frame_linking = plot.linking_between_frames
|
|
45
|
+
>>> frame_linking.group = 1
|
|
46
|
+
>>> frame_linking.link_frame_size_and_position = True
|
|
47
|
+
"""
|
|
48
|
+
return self._get_style(bool, sv.LINKFRAMESIZEANDPOSITION)
|
|
49
|
+
|
|
50
|
+
@link_frame_size_and_position.setter
|
|
51
|
+
def link_frame_size_and_position(self, value):
|
|
52
|
+
self._set_style(bool(value), sv.LINKFRAMESIZEANDPOSITION)
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def link_solution_time(self):
|
|
56
|
+
"""`bool`: Match current solution time.
|
|
57
|
+
|
|
58
|
+
Keeps the same active solution time across all frames in the specified
|
|
59
|
+
`group`. Example usage::
|
|
60
|
+
|
|
61
|
+
>>> frame_linking = plot.linking_between_frames
|
|
62
|
+
>>> frame_linking.group = 1
|
|
63
|
+
>>> frame_linking.link_solution_time = True
|
|
64
|
+
"""
|
|
65
|
+
return self._get_style(bool, sv.LINKSOLUTIONTIME)
|
|
66
|
+
|
|
67
|
+
@link_solution_time.setter
|
|
68
|
+
def link_solution_time(self, value):
|
|
69
|
+
return self._set_style(bool(value), sv.LINKSOLUTIONTIME)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class DataPlotLinkingBetweenFrames(SketchPlotLinkingBetweenFrames):
|
|
73
|
+
@property
|
|
74
|
+
def link_value_blanking(self):
|
|
75
|
+
"""`bool`: Match all value blanking style settings.
|
|
76
|
+
|
|
77
|
+
Keeps the same value blanking across all frames in the specified
|
|
78
|
+
`group`. Example usage::
|
|
79
|
+
|
|
80
|
+
>>> frame_linking = plot.linking_between_frames
|
|
81
|
+
>>> frame_linking.group = 1
|
|
82
|
+
>>> frame_linking.link_value_blanking = True
|
|
83
|
+
"""
|
|
84
|
+
return self._get_style(bool, sv.LINKVALUEBLANKING)
|
|
85
|
+
|
|
86
|
+
@link_value_blanking.setter
|
|
87
|
+
def link_value_blanking(self, value):
|
|
88
|
+
self._set_style(bool(value), sv.LINKVALUEBLANKING)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class XYLinePlotLinkingBetweenFrames(DataPlotLinkingBetweenFrames):
|
|
92
|
+
"""`XYLinePlot` `Frame <layout.Frame>` style linking control.
|
|
93
|
+
|
|
94
|
+
.. seealso:: `Cartesian3DPlotLinkingBetweenFrames` for details on how to
|
|
95
|
+
link style across multiple frames.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
@property
|
|
99
|
+
def link_x_axis_range(self):
|
|
100
|
+
"""`bool`: Match x-axis range.
|
|
101
|
+
|
|
102
|
+
Keeps the same x-axis range across all frames in the specified `group`.
|
|
103
|
+
Example usage::
|
|
104
|
+
|
|
105
|
+
>>> frame_linking = plot.linking_between_frames
|
|
106
|
+
>>> frame_linking.group = 1
|
|
107
|
+
>>> frame_linking.link_x_axis_range = True
|
|
108
|
+
"""
|
|
109
|
+
return self._get_style(bool, sv.LINKXAXISRANGE)
|
|
110
|
+
|
|
111
|
+
@link_x_axis_range.setter
|
|
112
|
+
def link_x_axis_range(self, value):
|
|
113
|
+
self._set_style(bool(value), sv.LINKXAXISRANGE)
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def link_y_axis_range(self):
|
|
117
|
+
"""`bool`: Match y-axis range.
|
|
118
|
+
|
|
119
|
+
Keeps the same y-axis range across all frames in the specified `group`.
|
|
120
|
+
Example usage::
|
|
121
|
+
|
|
122
|
+
>>> frame_linking = plot.linking_between_frames
|
|
123
|
+
>>> frame_linking.group = 1
|
|
124
|
+
>>> frame_linking.link_y_axis_range = True
|
|
125
|
+
"""
|
|
126
|
+
return self._get_style(bool, sv.LINKYAXISRANGE)
|
|
127
|
+
|
|
128
|
+
@link_y_axis_range.setter
|
|
129
|
+
def link_y_axis_range(self, value):
|
|
130
|
+
self._set_style(bool(value), sv.LINKYAXISRANGE)
|
|
131
|
+
|
|
132
|
+
@property
|
|
133
|
+
def link_axis_position(self):
|
|
134
|
+
"""`bool`: Match axis position within the frames.
|
|
135
|
+
|
|
136
|
+
Keeps the same axis position across all frames in the specified
|
|
137
|
+
`group`. Example usage::
|
|
138
|
+
|
|
139
|
+
>>> frame_linking = plot.linking_between_frames
|
|
140
|
+
>>> frame_linking.group = 1
|
|
141
|
+
>>> frame_linking.link_axis_position = True
|
|
142
|
+
"""
|
|
143
|
+
return self._get_style(bool, sv.LINKAXISPOSITION)
|
|
144
|
+
|
|
145
|
+
@link_axis_position.setter
|
|
146
|
+
def link_axis_position(self, value):
|
|
147
|
+
self._set_style(bool(value), sv.LINKAXISPOSITION)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class FieldPlotLinkingBetweenFrames(DataPlotLinkingBetweenFrames):
|
|
151
|
+
@property
|
|
152
|
+
def link_contour_levels(self):
|
|
153
|
+
"""`bool`: Match all contour levels.
|
|
154
|
+
|
|
155
|
+
Keeps the same contour levels across all frames in the specified
|
|
156
|
+
`group`. Example usage::
|
|
157
|
+
|
|
158
|
+
>>> frame_linking = plot.linking_between_frames
|
|
159
|
+
>>> frame_linking.group = 1
|
|
160
|
+
>>> frame_linking.link_contour_levels = True
|
|
161
|
+
"""
|
|
162
|
+
return self._get_style(bool, sv.LINKCONTOURLEVELS)
|
|
163
|
+
|
|
164
|
+
@link_contour_levels.setter
|
|
165
|
+
def link_contour_levels(self, value):
|
|
166
|
+
self._set_style(bool(value), sv.LINKCONTOURLEVELS)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class Cartesian2DPlotLinkingBetweenFrames(FieldPlotLinkingBetweenFrames,
|
|
170
|
+
XYLinePlotLinkingBetweenFrames):
|
|
171
|
+
"""`Cartesian2DFieldPlot` `Frame <layout.Frame>` style linking control.
|
|
172
|
+
|
|
173
|
+
.. seealso:: `Cartesian3DPlotLinkingBetweenFrames` for details on how to
|
|
174
|
+
link style across multiple frames.
|
|
175
|
+
"""
|
|
176
|
+
|
|
177
|
+
class Cartesian3DPlotLinkingBetweenFrames(FieldPlotLinkingBetweenFrames):
|
|
178
|
+
"""`Cartesian3DFieldPlot` `Frame <layout.Frame>` style linking control.
|
|
179
|
+
|
|
180
|
+
The following example shows how to set up a series of transparent overlay
|
|
181
|
+
frames where each overlay shows one component of the :math:`(U, V, W)`
|
|
182
|
+
vector from the `Dataset <data.Dataset>`. All four frames are linked to each other (group
|
|
183
|
+
1) so they have the same size, position and view.
|
|
184
|
+
|
|
185
|
+
.. code-block:: python
|
|
186
|
+
:emphasize-lines: 36-39,62-65,82-83
|
|
187
|
+
|
|
188
|
+
import os
|
|
189
|
+
|
|
190
|
+
import tecplot as tp
|
|
191
|
+
from tecplot.constant import *
|
|
192
|
+
|
|
193
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
194
|
+
infile = os.path.join(examples_dir, 'SimpleData', 'DuctFlow.plt')
|
|
195
|
+
dataset = tp.data.load_tecplot(infile)
|
|
196
|
+
|
|
197
|
+
# Create a "blank" (zeroed-out) variable to use when plotting
|
|
198
|
+
# only one component of the (U, V, W) vectors
|
|
199
|
+
tp.data.operate.execute_equation(r'{blank} = 0')
|
|
200
|
+
|
|
201
|
+
# Setup the background frame and plot style
|
|
202
|
+
frame = tp.active_frame()
|
|
203
|
+
frame.background_color = Color.Black
|
|
204
|
+
|
|
205
|
+
plot = frame.plot(PlotType.Cartesian3D)
|
|
206
|
+
plot.activate()
|
|
207
|
+
|
|
208
|
+
contour = plot.contour(0)
|
|
209
|
+
contour.variable = dataset.variable('P(N/m2)')
|
|
210
|
+
contour.legend.show = False
|
|
211
|
+
|
|
212
|
+
plot.use_translucency = True
|
|
213
|
+
plot.show_contour = True
|
|
214
|
+
plot.show_edge = True
|
|
215
|
+
plot.axes.orientation_axis.color = Color.White
|
|
216
|
+
plot.view.width = 2.43
|
|
217
|
+
|
|
218
|
+
fmap = plot.fieldmap(0)
|
|
219
|
+
fmap.edge.edge_type = EdgeType.Creases
|
|
220
|
+
fmap.edge.color = Color.White
|
|
221
|
+
fmap.surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces
|
|
222
|
+
|
|
223
|
+
frame_linking = plot.linking_between_frames
|
|
224
|
+
frame_linking.group = 1
|
|
225
|
+
frame_linking.link_view = True
|
|
226
|
+
frame_linking.link_frame_size_and_position = True
|
|
227
|
+
|
|
228
|
+
def add_transparent_overlay(frame):
|
|
229
|
+
'''Creates a transparent frame overlay with "blank" vector variables.'''
|
|
230
|
+
overlay_frame = frame.page.add_frame()
|
|
231
|
+
overlay_frame.transparent = True
|
|
232
|
+
|
|
233
|
+
plot = overlay_frame.plot(frame.plot_type)
|
|
234
|
+
plot.activate()
|
|
235
|
+
plot.show_shade = False
|
|
236
|
+
plot.axes.orientation_axis.show = False
|
|
237
|
+
|
|
238
|
+
blank_var = overlay_frame.dataset.variable('blank')
|
|
239
|
+
plot.vector.u_variable = blank_var
|
|
240
|
+
plot.vector.v_variable = blank_var
|
|
241
|
+
plot.vector.w_variable = blank_var
|
|
242
|
+
plot.show_vector = True
|
|
243
|
+
|
|
244
|
+
fmap = plot.fieldmap(0)
|
|
245
|
+
fmap.vector.line_thickness = 0.35
|
|
246
|
+
fmap.points.step = 80
|
|
247
|
+
fmap.points.points_to_plot = PointsToPlot.AllCellCenters
|
|
248
|
+
|
|
249
|
+
frame_linking = plot.linking_between_frames
|
|
250
|
+
frame_linking.group = 1
|
|
251
|
+
frame_linking.link_view = True
|
|
252
|
+
frame_linking.link_frame_size_and_position = True
|
|
253
|
+
|
|
254
|
+
return plot
|
|
255
|
+
|
|
256
|
+
# Create three overlays - one for each vector component we want to show
|
|
257
|
+
u_plot = add_transparent_overlay(frame)
|
|
258
|
+
u_plot.vector.u_variable = dataset.variable('U(M/S)')
|
|
259
|
+
u_plot.fieldmap(0).vector.color = Color.Red
|
|
260
|
+
|
|
261
|
+
v_plot = add_transparent_overlay(frame)
|
|
262
|
+
v_plot.vector.v_variable = dataset.variable('V(M/S)')
|
|
263
|
+
v_plot.fieldmap(0).vector.color = Color.Green
|
|
264
|
+
|
|
265
|
+
w_plot = add_transparent_overlay(frame)
|
|
266
|
+
w_plot.vector.w_variable = dataset.variable('W(M/S)')
|
|
267
|
+
w_plot.fieldmap(0).vector.color = Color.Blue
|
|
268
|
+
|
|
269
|
+
# Now that all plots have been linked,
|
|
270
|
+
# movement in one will affect all three plots.
|
|
271
|
+
u_plot.view.translate(x=5)
|
|
272
|
+
|
|
273
|
+
tp.export.save_png('plot3d_linking_between_frames.png')
|
|
274
|
+
|
|
275
|
+
.. figure:: /_static/images/plot3d_linking_between_frames.png
|
|
276
|
+
:width: 300px
|
|
277
|
+
:figwidth: 300px
|
|
278
|
+
"""
|
|
279
|
+
|
|
280
|
+
@property
|
|
281
|
+
def link_view(self):
|
|
282
|
+
"""`bool`: Match the view orientation and position.
|
|
283
|
+
|
|
284
|
+
Keeps the same view across all frames in the specified `group`. Example
|
|
285
|
+
usage::
|
|
286
|
+
|
|
287
|
+
>>> frame_linking = plot.linking_between_frames
|
|
288
|
+
>>> frame_linking.group = 1
|
|
289
|
+
>>> frame_linking.link_view = True
|
|
290
|
+
"""
|
|
291
|
+
return self._get_style(bool, sv.LINK3DVIEW)
|
|
292
|
+
|
|
293
|
+
@link_view.setter
|
|
294
|
+
def link_view(self, value):
|
|
295
|
+
self._set_style(bool(value), sv.LINK3DVIEW)
|
|
296
|
+
|
|
297
|
+
@property
|
|
298
|
+
def link_slice_positions(self):
|
|
299
|
+
"""`bool`: Match slice positions.
|
|
300
|
+
|
|
301
|
+
Keeps the same slice positions across all frames in the specified
|
|
302
|
+
`group`. Example usage::
|
|
303
|
+
|
|
304
|
+
>>> frame_linking = plot.linking_between_frames
|
|
305
|
+
>>> frame_linking.group = 1
|
|
306
|
+
>>> frame_linking.link_slice_positions = True
|
|
307
|
+
"""
|
|
308
|
+
return self._get_style(bool, sv.LINKSLICEPOSITIONS)
|
|
309
|
+
|
|
310
|
+
@link_slice_positions.setter
|
|
311
|
+
def link_slice_positions(self, value):
|
|
312
|
+
self._set_style(bool(value), sv.LINKSLICEPOSITIONS)
|
|
313
|
+
|
|
314
|
+
@property
|
|
315
|
+
def link_isosurface_values(self):
|
|
316
|
+
"""`bool`: Match isosurface values.
|
|
317
|
+
|
|
318
|
+
Keeps the same isosurfaces across all frames in the specified `group`.
|
|
319
|
+
Example usage::
|
|
320
|
+
|
|
321
|
+
>>> frame_linking = plot.linking_between_frames
|
|
322
|
+
>>> frame_linking.group = 1
|
|
323
|
+
>>> frame_linking.link_isosurface_values = True
|
|
324
|
+
"""
|
|
325
|
+
return self._get_style(bool, sv.LINKISOSURFACEVALUES)
|
|
326
|
+
|
|
327
|
+
@link_isosurface_values.setter
|
|
328
|
+
def link_isosurface_values(self, value):
|
|
329
|
+
self._set_style(bool(value), sv.LINKISOSURFACEVALUES)
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
class PolarPlotLinkingBetweenFrames(DataPlotLinkingBetweenFrames):
|
|
333
|
+
"""`PolarLinePlot` `Frame <layout.Frame>` style linking control.
|
|
334
|
+
|
|
335
|
+
.. seealso:: `Cartesian3DPlotLinkingBetweenFrames` for details on how to
|
|
336
|
+
link style across multiple frames.
|
|
337
|
+
"""
|
|
338
|
+
|
|
339
|
+
@property
|
|
340
|
+
def link_view(self):
|
|
341
|
+
"""`bool`: Match polar view settings.
|
|
342
|
+
|
|
343
|
+
Keeps the same view across all frames in the specified `group` showing
|
|
344
|
+
a polar plot. Example usage::
|
|
345
|
+
|
|
346
|
+
>>> frame_linking = plot.linking_between_frames
|
|
347
|
+
>>> frame_linking.group = 1
|
|
348
|
+
>>> frame_linking.link_view = True
|
|
349
|
+
"""
|
|
350
|
+
return self._get_style(bool, sv.LINKPOLARVIEW)
|
|
351
|
+
|
|
352
|
+
@link_view.setter
|
|
353
|
+
def link_view(self, value):
|
|
354
|
+
self._set_style(bool(value), sv.LINKPOLARVIEW)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
class LinkingWithinFrame(session.Style):
|
|
358
|
+
"""`SketchPlot` style linking control within a `Frame <layout.Frame>`.
|
|
359
|
+
|
|
360
|
+
.. seealso:: `FieldPlotLinkingWithinFrame` for details on how to setup
|
|
361
|
+
style linking within a `Frame <layout.Frame>`.
|
|
362
|
+
|
|
363
|
+
.. seealso:: `Cartesian3DPlotLinkingBetweenFrames` for details on how to
|
|
364
|
+
link style across multiple frames.
|
|
365
|
+
"""
|
|
366
|
+
def __init__(self, frame):
|
|
367
|
+
self.frame = frame
|
|
368
|
+
super().__init__(sv.LINKING, sv.WITHINFRAME, uniqueid=frame.uid)
|
|
369
|
+
|
|
370
|
+
@property
|
|
371
|
+
def link_axis_style(self):
|
|
372
|
+
"""`bool`: Match axis style.
|
|
373
|
+
|
|
374
|
+
Keeps the same axis style across all axes within the `Frame <layout.Frame>`.
|
|
375
|
+
|
|
376
|
+
>>> frame_linking = plot.linking_within_frame
|
|
377
|
+
>>> frame_linking.link_axis_style = True
|
|
378
|
+
"""
|
|
379
|
+
return self._get_style(bool, sv.LINKAXISSTYLE)
|
|
380
|
+
|
|
381
|
+
@link_axis_style.setter
|
|
382
|
+
def link_axis_style(self, value):
|
|
383
|
+
self._set_style(bool(value), sv.LINKAXISSTYLE)
|
|
384
|
+
|
|
385
|
+
@property
|
|
386
|
+
def link_gridline_style(self):
|
|
387
|
+
"""`bool`: Match gridline style.
|
|
388
|
+
|
|
389
|
+
Keeps the same style gridlines across all axes within the `Frame <layout.Frame>`.
|
|
390
|
+
|
|
391
|
+
>>> frame_linking = plot.linking_within_frame
|
|
392
|
+
>>> frame_linking.link_gridline_style = True
|
|
393
|
+
"""
|
|
394
|
+
return self._get_style(bool, sv.LINKGRIDLINESTYLE)
|
|
395
|
+
|
|
396
|
+
@link_gridline_style.setter
|
|
397
|
+
def link_gridline_style(self, value):
|
|
398
|
+
self._set_style(bool(value), sv.LINKGRIDLINESTYLE)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
class DataPlotLinkingWithinFrame(LinkingWithinFrame):
|
|
402
|
+
"""`XYLinePlot` and `PolarLinePlot` style linking control within a `Frame <layout.Frame>`.
|
|
403
|
+
|
|
404
|
+
.. seealso:: `FieldPlotLinkingWithinFrame` for details on how to setup
|
|
405
|
+
style linking within a `Frame <layout.Frame>`.
|
|
406
|
+
|
|
407
|
+
.. seealso:: `Cartesian3DPlotLinkingBetweenFrames` for details on how to
|
|
408
|
+
link style across multiple frames.
|
|
409
|
+
"""
|
|
410
|
+
|
|
411
|
+
@property
|
|
412
|
+
def link_layer_line_color(self):
|
|
413
|
+
"""`bool`: Match line colors.
|
|
414
|
+
|
|
415
|
+
Keeps the same line colors across all layers within the `Frame <layout.Frame>`.
|
|
416
|
+
|
|
417
|
+
>>> frame_linking = plot.linking_within_frame
|
|
418
|
+
>>> frame_linking.link_layer_line_color = True
|
|
419
|
+
"""
|
|
420
|
+
return self._get_style(bool, sv.LINKLAYERLINECOLOR)
|
|
421
|
+
|
|
422
|
+
@link_layer_line_color.setter
|
|
423
|
+
def link_layer_line_color(self, value):
|
|
424
|
+
self._set_style(bool(value), sv.LINKLAYERLINECOLOR)
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
class FieldPlotLinkingWithinFrame(DataPlotLinkingWithinFrame):
|
|
428
|
+
"""2D and 3D cartesian plot style linking control within a `Frame <layout.Frame>`.
|
|
429
|
+
|
|
430
|
+
.. seealso:: `Cartesian3DPlotLinkingBetweenFrames` for details on how to
|
|
431
|
+
link style across multiple frames.
|
|
432
|
+
|
|
433
|
+
.. code-block:: python
|
|
434
|
+
:emphasize-lines: 13-15,20-21
|
|
435
|
+
|
|
436
|
+
import os
|
|
437
|
+
import tecplot as tp
|
|
438
|
+
from tecplot.constant import *
|
|
439
|
+
|
|
440
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
441
|
+
infile = os.path.join(examples_dir, 'SimpleData', 'Sphere.lpk')
|
|
442
|
+
tp.load_layout(infile)
|
|
443
|
+
|
|
444
|
+
dataset = tp.active_frame().dataset
|
|
445
|
+
frame = tp.active_frame()
|
|
446
|
+
plot = frame.plot()
|
|
447
|
+
|
|
448
|
+
frame_linking = plot.linking_within_frame
|
|
449
|
+
frame_linking.link_gridline_style = True
|
|
450
|
+
frame_linking.link_axis_style = True
|
|
451
|
+
|
|
452
|
+
plot.axes.grid_area.fill_color = Color.Mahogany
|
|
453
|
+
plot.axes.grid_area.use_lighting_effect = False
|
|
454
|
+
|
|
455
|
+
# With linked axis style, we only need to modify
|
|
456
|
+
# one axis and all others will get the same.
|
|
457
|
+
axis = plot.axes.x_axis
|
|
458
|
+
axis.show = True
|
|
459
|
+
axis.grid_lines.line_thickness = 0.2
|
|
460
|
+
axis.title.color = Color.Green
|
|
461
|
+
axis.ticks.show_on_opposite_edge = True
|
|
462
|
+
axis.minor_grid_lines.show = True
|
|
463
|
+
axis.minor_grid_lines.line_pattern = LinePattern.Dotted
|
|
464
|
+
axis.minor_grid_lines.color = Color.Cyan
|
|
465
|
+
axis.line.line_thickness = 0.2
|
|
466
|
+
|
|
467
|
+
plot.view.fit()
|
|
468
|
+
|
|
469
|
+
tp.export.save_png('field_plot_link_within_frame.png')
|
|
470
|
+
|
|
471
|
+
.. figure:: /_static/images/field_plot_linking_within_frame.png
|
|
472
|
+
:width: 300px
|
|
473
|
+
:figwidth: 300px
|
|
474
|
+
"""
|
|
475
|
+
|
|
476
|
+
@property
|
|
477
|
+
def link_layer_line_pattern(self):
|
|
478
|
+
"""`bool`: Match line pattern.
|
|
479
|
+
|
|
480
|
+
Keeps the same pattern across lines within the `Frame <layout.Frame>`.
|
|
481
|
+
|
|
482
|
+
>>> frame_linking = plot.linking_within_frame
|
|
483
|
+
>>> frame_linking.link_layer_line_pattern = True
|
|
484
|
+
"""
|
|
485
|
+
return self._get_style(bool, sv.LINKLAYERLINEPATTERN)
|
|
486
|
+
|
|
487
|
+
@link_layer_line_pattern.setter
|
|
488
|
+
def link_layer_line_pattern(self, value):
|
|
489
|
+
self._set_style(bool(value), sv.LINKLAYERLINEPATTERN)
|