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/labels.py
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
from builtins import int, super
|
|
2
|
+
|
|
3
|
+
from ..constant import *
|
|
4
|
+
from ..exception import *
|
|
5
|
+
from ..tecutil import sv
|
|
6
|
+
from .. import session, tecutil, text
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DataLabels(session.Style):
|
|
10
|
+
@property
|
|
11
|
+
def show_node_labels(self):
|
|
12
|
+
"""`bool`: Display labels at each node.
|
|
13
|
+
|
|
14
|
+
Example usage::
|
|
15
|
+
|
|
16
|
+
>>> plot.data_labels.show_node_labels = True
|
|
17
|
+
"""
|
|
18
|
+
return self._get_style(bool, sv.SHOWNODELABELS)
|
|
19
|
+
|
|
20
|
+
@show_node_labels.setter
|
|
21
|
+
def show_node_labels(self, value):
|
|
22
|
+
self._set_style(bool(value), sv.SHOWNODELABELS)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def node_label_type(self):
|
|
26
|
+
"""`LabelType`: The value to be displayed for node labels.
|
|
27
|
+
|
|
28
|
+
Possible values are `LabelType.Index` or `LabelType.VarValue`::
|
|
29
|
+
|
|
30
|
+
>>> from tecplot.constant import LabelType
|
|
31
|
+
>>> plot.data_labels.show_node_labels = True
|
|
32
|
+
>>> plot.data_labels.node_label_type = LabelType.VarValue
|
|
33
|
+
"""
|
|
34
|
+
return self._get_style(LabelType, sv.NODELABELTYPE)
|
|
35
|
+
|
|
36
|
+
@node_label_type.setter
|
|
37
|
+
def node_label_type(self, value):
|
|
38
|
+
self._set_style(LabelType(value), sv.NODELABELTYPE)
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def index_step(self):
|
|
42
|
+
"""`int`: Step interval between labels.
|
|
43
|
+
|
|
44
|
+
A value of 1 displays labels on all nodes or cells. Example usage::
|
|
45
|
+
|
|
46
|
+
>>> plot.data_labels.show_node_labels = True
|
|
47
|
+
>>> plot.data_labels.index_step = 10
|
|
48
|
+
|
|
49
|
+
.. seealso:: `LinePlotDataLabels.step_mode` for line plots.
|
|
50
|
+
"""
|
|
51
|
+
return self._get_style(int, sv.INDEXSKIP)
|
|
52
|
+
|
|
53
|
+
@index_step.setter
|
|
54
|
+
def index_step(self, value):
|
|
55
|
+
self._set_style(int(value), sv.INDEXSKIP)
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def color_by_map(self):
|
|
59
|
+
"""`bool`: Inherit `Color` from the symbol or scatter mapping style.
|
|
60
|
+
|
|
61
|
+
Example usage for linemaps::
|
|
62
|
+
|
|
63
|
+
>>> from tecplot.constant import Color
|
|
64
|
+
>>> plot.linemap(0).symbols.color = Color.Blue
|
|
65
|
+
>>> plot.data_labels.show_node_labels = True
|
|
66
|
+
>>> plot.data_labels.color_by_map = True
|
|
67
|
+
|
|
68
|
+
Example usage for fieldmaps::
|
|
69
|
+
|
|
70
|
+
>>> from tecplot.constant import Color
|
|
71
|
+
>>> plot.fieldmap(0).scatter.color = Color.Yellow
|
|
72
|
+
>>> plot.data_labels.show_node_labels = True
|
|
73
|
+
>>> plot.data_labels.color_by_map = True
|
|
74
|
+
"""
|
|
75
|
+
return self._get_style(bool, sv.COLORBYZONEMAP)
|
|
76
|
+
|
|
77
|
+
@color_by_map.setter
|
|
78
|
+
def color_by_map(self, value):
|
|
79
|
+
self._set_style(bool(value), sv.COLORBYZONEMAP)
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def color(self):
|
|
83
|
+
"""`Color`: The `Color` of the data labels.
|
|
84
|
+
|
|
85
|
+
Example usage::
|
|
86
|
+
|
|
87
|
+
>>> from tecplot.constant import Color
|
|
88
|
+
>>> plot.data_labels.show_node_labels = True
|
|
89
|
+
>>> plot.data_labels.color = Color.LightBlue
|
|
90
|
+
"""
|
|
91
|
+
return self._get_style(Color, sv.COLOR)
|
|
92
|
+
|
|
93
|
+
@color.setter
|
|
94
|
+
def color(self, value):
|
|
95
|
+
self._set_style(Color(value), sv.COLOR)
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def show_box(self):
|
|
99
|
+
"""`bool`: Show a box around each label.
|
|
100
|
+
|
|
101
|
+
This is `True` by default. Set to `False` to disable the box::
|
|
102
|
+
|
|
103
|
+
>>> plot.data_labels.show_node_labels = True
|
|
104
|
+
>>> plot.data_labels.show_box = False
|
|
105
|
+
"""
|
|
106
|
+
return self._get_style(bool, sv.INCLUDEBOX)
|
|
107
|
+
|
|
108
|
+
@show_box.setter
|
|
109
|
+
def show_box(self, value):
|
|
110
|
+
self._set_style(bool(value), sv.INCLUDEBOX)
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def font(self):
|
|
114
|
+
"""`text.Font`: Typeface control for all data labels.
|
|
115
|
+
|
|
116
|
+
Example usage::
|
|
117
|
+
|
|
118
|
+
>>> plot.data_labels.font.typeface = 'Times'
|
|
119
|
+
"""
|
|
120
|
+
return text.Font(self)
|
|
121
|
+
|
|
122
|
+
@property
|
|
123
|
+
def label_format(self):
|
|
124
|
+
"""`text.LabelFormat`: Floating-point number format control.
|
|
125
|
+
|
|
126
|
+
Example usage::
|
|
127
|
+
|
|
128
|
+
>>> from tecplot.constant import NumberFormat
|
|
129
|
+
>>> labels = plot.data_labels
|
|
130
|
+
>>> labels.label_format.format_type = NumberFormat.Integer
|
|
131
|
+
"""
|
|
132
|
+
return text.LabelFormat(self)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class FieldPlotDataLabels(DataLabels):
|
|
136
|
+
"""Node and cell labels for field plots.
|
|
137
|
+
|
|
138
|
+
.. code-block:: python
|
|
139
|
+
:emphasize-lines: 20-25
|
|
140
|
+
|
|
141
|
+
from os import path
|
|
142
|
+
import tecplot as tp
|
|
143
|
+
from tecplot.constant import LabelType, NumberFormat, PlotType
|
|
144
|
+
|
|
145
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
146
|
+
infile = path.join(examples_dir, 'SimpleData', 'RainierElevation.plt')
|
|
147
|
+
dataset = tp.data.load_tecplot(infile)
|
|
148
|
+
|
|
149
|
+
frame = tp.active_frame()
|
|
150
|
+
plot = frame.plot(PlotType.Cartesian2D)
|
|
151
|
+
plot.activate()
|
|
152
|
+
plot.show_contour = True
|
|
153
|
+
plot.contour(0).legend.show = False
|
|
154
|
+
|
|
155
|
+
plot.axes.x_axis.min = -8500
|
|
156
|
+
plot.axes.x_axis.max = 8200
|
|
157
|
+
plot.axes.y_axis.min = -400
|
|
158
|
+
plot.axes.y_axis.max = -150
|
|
159
|
+
|
|
160
|
+
plot.data_labels.show_node_labels = True
|
|
161
|
+
plot.data_labels.node_label_type = LabelType.VarValue
|
|
162
|
+
plot.data_labels.node_variable = dataset.variable('E')
|
|
163
|
+
plot.data_labels.index_step = 4
|
|
164
|
+
plot.data_labels.label_format.format_type = NumberFormat.Integer
|
|
165
|
+
plot.data_labels.show_box = False
|
|
166
|
+
|
|
167
|
+
tp.export.save_png('field_plot_data_labels.png')
|
|
168
|
+
|
|
169
|
+
.. figure:: /_static/images/field_plot_data_labels.png
|
|
170
|
+
:width: 300px
|
|
171
|
+
:figwidth: 300px
|
|
172
|
+
"""
|
|
173
|
+
def __init__(self, plot):
|
|
174
|
+
self.plot = plot
|
|
175
|
+
super().__init__(sv.GLOBALSCATTER, sv.DATALABELS, **plot._kw)
|
|
176
|
+
|
|
177
|
+
@property
|
|
178
|
+
def show_cell_labels(self):
|
|
179
|
+
"""`bool`: Display labels at each cell.
|
|
180
|
+
|
|
181
|
+
Example usage::
|
|
182
|
+
|
|
183
|
+
>>> plot.data_labels.show_cell_labels = True
|
|
184
|
+
"""
|
|
185
|
+
return self._get_style(bool, sv.SHOWCELLLABELS)
|
|
186
|
+
|
|
187
|
+
@show_cell_labels.setter
|
|
188
|
+
def show_cell_labels(self, value):
|
|
189
|
+
self._set_style(bool(value), sv.SHOWCELLLABELS)
|
|
190
|
+
|
|
191
|
+
@property
|
|
192
|
+
def cell_label_type(self):
|
|
193
|
+
"""`LabelType`: The value to be displayed for cell labels.
|
|
194
|
+
|
|
195
|
+
Possible values are `LabelType.Index` or `LabelType.VarValue`::
|
|
196
|
+
|
|
197
|
+
>>> plot.data_labels.show_cell_labels = True
|
|
198
|
+
>>> plot.data_labels.cell_label_type = LabelType.VarValue
|
|
199
|
+
"""
|
|
200
|
+
return self._get_style(LabelType, sv.CELLLABELTYPE)
|
|
201
|
+
|
|
202
|
+
@cell_label_type.setter
|
|
203
|
+
def cell_label_type(self, value):
|
|
204
|
+
self._set_style(LabelType(value), sv.CELLLABELTYPE)
|
|
205
|
+
|
|
206
|
+
@property
|
|
207
|
+
def cell_variable_index(self):
|
|
208
|
+
"""`Index`: `Index` of the variable to use for cell labels.
|
|
209
|
+
|
|
210
|
+
Example usage::
|
|
211
|
+
|
|
212
|
+
>>> from tecplot.constant import LabelType
|
|
213
|
+
>>> plot.data_labels.show_cell_labels = True
|
|
214
|
+
>>> plot.data_labels.cell_label_type = LabelType.VarValue
|
|
215
|
+
>>> plot.data_labels.cell_variable_index = 3
|
|
216
|
+
"""
|
|
217
|
+
return self._get_style(tecutil.Index, sv.CELLLABELVAR)
|
|
218
|
+
|
|
219
|
+
@cell_variable_index.setter
|
|
220
|
+
def cell_variable_index(self, value):
|
|
221
|
+
self._set_style(tecutil.Index(value), sv.CELLLABELVAR)
|
|
222
|
+
|
|
223
|
+
@property
|
|
224
|
+
def cell_variable(self):
|
|
225
|
+
"""`Variable`: `Variable` to use for cell labels.
|
|
226
|
+
|
|
227
|
+
Example usage::
|
|
228
|
+
|
|
229
|
+
>>> from tecplot.constant import LabelType
|
|
230
|
+
>>> plot.data_labels.show_cell_labels = True
|
|
231
|
+
>>> plot.data_labels.cell_label_type = LabelType.VarValue
|
|
232
|
+
>>> plot.data_labels.cell_variable = dataset.variable('E')
|
|
233
|
+
"""
|
|
234
|
+
i = self.cell_variable_index
|
|
235
|
+
return self.plot.frame.dataset.variable(i)
|
|
236
|
+
|
|
237
|
+
@cell_variable.setter
|
|
238
|
+
def cell_variable(self, value):
|
|
239
|
+
self.cell_variable_index = value.index
|
|
240
|
+
|
|
241
|
+
@property
|
|
242
|
+
def node_variable_index(self):
|
|
243
|
+
"""`Index`: `Index` of the variable to use for node labels.
|
|
244
|
+
|
|
245
|
+
Example usage::
|
|
246
|
+
|
|
247
|
+
>>> from tecplot.constant import LabelType
|
|
248
|
+
>>> plot.data_labels.show_node_labels = True
|
|
249
|
+
>>> plot.data_labels.node_label_type = LabelType.VarValue
|
|
250
|
+
>>> plot.data_labels.node_variable_index = 3
|
|
251
|
+
"""
|
|
252
|
+
return self._get_style(tecutil.Index, sv.NODELABELVAR)
|
|
253
|
+
|
|
254
|
+
@node_variable_index.setter
|
|
255
|
+
def node_variable_index(self, value):
|
|
256
|
+
self._set_style(tecutil.Index(value), sv.NODELABELVAR)
|
|
257
|
+
|
|
258
|
+
@property
|
|
259
|
+
def node_variable(self):
|
|
260
|
+
"""`Variable`: `Variable` to use for node labels.
|
|
261
|
+
|
|
262
|
+
Example usage::
|
|
263
|
+
|
|
264
|
+
>>> from tecplot.constant import LabelType
|
|
265
|
+
>>> plot.data_labels.show_node_labels = True
|
|
266
|
+
>>> plot.data_labels.node_label_type = LabelType.VarValue
|
|
267
|
+
>>> plot.data_labels.node_variable = dataset.variable('E')
|
|
268
|
+
"""
|
|
269
|
+
i = self.node_variable_index
|
|
270
|
+
return self.plot.frame.dataset.variable(i)
|
|
271
|
+
|
|
272
|
+
@node_variable.setter
|
|
273
|
+
def node_variable(self, value):
|
|
274
|
+
self.node_variable_index = value.index
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
class LinePlotDataLabels(DataLabels):
|
|
278
|
+
"""Node labels for line plots.
|
|
279
|
+
|
|
280
|
+
.. code-block:: python
|
|
281
|
+
:emphasize-lines: 12-13
|
|
282
|
+
|
|
283
|
+
from os import path
|
|
284
|
+
import tecplot as tp
|
|
285
|
+
from tecplot.constant import PlotType
|
|
286
|
+
|
|
287
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
288
|
+
infile = path.join(examples_dir, 'SimpleData', 'SunSpots.plt')
|
|
289
|
+
dataset = tp.data.load_tecplot(infile)
|
|
290
|
+
|
|
291
|
+
frame = tp.active_frame()
|
|
292
|
+
plot = frame.plot(PlotType.XYLine)
|
|
293
|
+
plot.activate()
|
|
294
|
+
plot.data_labels.show_node_labels = True
|
|
295
|
+
plot.data_labels.index_step = 3
|
|
296
|
+
|
|
297
|
+
tp.export.save_png('line_plot_data_labels.png')
|
|
298
|
+
|
|
299
|
+
.. figure:: /_static/images/line_plot_data_labels.png
|
|
300
|
+
:width: 300px
|
|
301
|
+
:figwidth: 300px
|
|
302
|
+
"""
|
|
303
|
+
def __init__(self, plot):
|
|
304
|
+
self.plot = plot
|
|
305
|
+
super().__init__(sv.GLOBALLINEPLOT, sv.DATALABELS, **plot._kw)
|
|
306
|
+
|
|
307
|
+
@property
|
|
308
|
+
def step_mode(self):
|
|
309
|
+
"""`StepMode`: The scale to use when stepping through elements.
|
|
310
|
+
|
|
311
|
+
Possible values are: `StepMode.ByIndex` and `StepMode.ByFrameUnits`.
|
|
312
|
+
Example usage::
|
|
313
|
+
|
|
314
|
+
>>> plot.data_labels.show_node_labels = True
|
|
315
|
+
>>> plot.data_labels.step_mode = StepMode.ByFrameUnits
|
|
316
|
+
>>> plot.data_labels.step_distance = 10.0
|
|
317
|
+
"""
|
|
318
|
+
return self._get_style(StepMode, sv.SKIPMODE)
|
|
319
|
+
|
|
320
|
+
@step_mode.setter
|
|
321
|
+
def step_mode(self, value):
|
|
322
|
+
self._set_style(StepMode(value), sv.SKIPMODE)
|
|
323
|
+
|
|
324
|
+
@property
|
|
325
|
+
def step_distance(self):
|
|
326
|
+
"""`float`: Distance between labels when stepping by frame units.
|
|
327
|
+
|
|
328
|
+
Example usage::
|
|
329
|
+
|
|
330
|
+
>>> plot.data_labels.show_node_labels = True
|
|
331
|
+
>>> plot.data_labels.step_mode = StepMode.ByFrameUnits
|
|
332
|
+
>>> plot.data_labels.step_distance = 10.0
|
|
333
|
+
"""
|
|
334
|
+
return self._get_style(float, sv.DISTANCESKIP)
|
|
335
|
+
|
|
336
|
+
@step_distance.setter
|
|
337
|
+
def step_distance(self, value):
|
|
338
|
+
self._set_style(float(value), sv.DISTANCESKIP)
|