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/ticks.py
ADDED
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
from builtins import int
|
|
2
|
+
|
|
3
|
+
from ..tecutil import _tecutil
|
|
4
|
+
from ..constant import *
|
|
5
|
+
from ..exception import *
|
|
6
|
+
from .. import session
|
|
7
|
+
from ..tecutil import Index, StringList, flatten_args, lock, sv
|
|
8
|
+
from ..text import Font, LabelFormat
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Ticks(session.Style):
|
|
12
|
+
def __init__(self, axis):
|
|
13
|
+
self.axis = axis
|
|
14
|
+
super().__init__(axis._sv, sv.TICKS, **axis._kw)
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def show(self):
|
|
18
|
+
"""`bool`: Draw ticks along axis.
|
|
19
|
+
|
|
20
|
+
Example usage::
|
|
21
|
+
|
|
22
|
+
>>> axis.ticks.show = True
|
|
23
|
+
"""
|
|
24
|
+
return self._get_style(bool, sv.SHOWONAXISLINE)
|
|
25
|
+
|
|
26
|
+
@show.setter
|
|
27
|
+
def show(self, value):
|
|
28
|
+
self._set_style(bool(value), sv.SHOWONAXISLINE)
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def direction(self):
|
|
32
|
+
"""`TickDirection`: How to draw the ticks with respect the axis line.
|
|
33
|
+
|
|
34
|
+
Possible values: `TickDirection.In`, `TickDirection.Out` or
|
|
35
|
+
`TickDirection.Centered`::
|
|
36
|
+
|
|
37
|
+
>>> from tecplot.constant import TickDirection
|
|
38
|
+
>>> axis.ticks.direction = TickDirection.Centered
|
|
39
|
+
"""
|
|
40
|
+
return self._get_style(TickDirection, sv.TICKDIRECTION)
|
|
41
|
+
|
|
42
|
+
@direction.setter
|
|
43
|
+
def direction(self, value):
|
|
44
|
+
self._set_style(TickDirection(value), sv.TICKDIRECTION)
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def length(self):
|
|
48
|
+
"""`float` (percent of frame height): Size of the major tick lines to draw.
|
|
49
|
+
|
|
50
|
+
Example usage::
|
|
51
|
+
|
|
52
|
+
>>> axis.ticks.length = 2
|
|
53
|
+
"""
|
|
54
|
+
return self._get_style(float, sv.LENGTH)
|
|
55
|
+
|
|
56
|
+
@length.setter
|
|
57
|
+
def length(self, value):
|
|
58
|
+
self._set_style(float(value), sv.LENGTH)
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def line_thickness(self):
|
|
62
|
+
"""`float`: Width of the major tick lines to be drawn.
|
|
63
|
+
|
|
64
|
+
Example usage::
|
|
65
|
+
|
|
66
|
+
>>> axis.ticks.line_thickness = 0.4
|
|
67
|
+
"""
|
|
68
|
+
return self._get_style(float, sv.LINETHICKNESS)
|
|
69
|
+
|
|
70
|
+
@line_thickness.setter
|
|
71
|
+
def line_thickness(self, value):
|
|
72
|
+
self._set_style(float(value), sv.LINETHICKNESS)
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def minor_num_ticks(self):
|
|
76
|
+
"""`int`: Number of minor ticks between each major tick.
|
|
77
|
+
|
|
78
|
+
Example usage::
|
|
79
|
+
|
|
80
|
+
>>> axis.ticks.minor_num_ticks = 3
|
|
81
|
+
"""
|
|
82
|
+
return self._get_style(int, sv.NUMMINORTICKS)
|
|
83
|
+
|
|
84
|
+
@minor_num_ticks.setter
|
|
85
|
+
def minor_num_ticks(self, value):
|
|
86
|
+
self._set_style(int(value), sv.NUMMINORTICKS)
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def minor_length(self):
|
|
90
|
+
"""`float` (percent of frame height): Size of the minor tick lines to draw.
|
|
91
|
+
|
|
92
|
+
Example usage::
|
|
93
|
+
|
|
94
|
+
>>> axis.ticks.minor_length = 1.2
|
|
95
|
+
"""
|
|
96
|
+
return self._get_style(float, sv.MINORLENGTH)
|
|
97
|
+
|
|
98
|
+
@minor_length.setter
|
|
99
|
+
def minor_length(self, value):
|
|
100
|
+
self._set_style(float(value), sv.MINORLENGTH)
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
def minor_line_thickness(self):
|
|
104
|
+
"""`float`: Width of the minor tick lines to be drawn.
|
|
105
|
+
|
|
106
|
+
Example usage::
|
|
107
|
+
|
|
108
|
+
>>> axis.ticks.minor_line_thickness = 0.1
|
|
109
|
+
"""
|
|
110
|
+
return self._get_style(float, sv.MINORLINETHICKNESS)
|
|
111
|
+
|
|
112
|
+
@minor_line_thickness.setter
|
|
113
|
+
def minor_line_thickness(self, value):
|
|
114
|
+
self._set_style(float(value), sv.MINORLINETHICKNESS)
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def auto_spacing(self):
|
|
118
|
+
"""`bool`: Automatically set the spacing between tick marks.
|
|
119
|
+
|
|
120
|
+
Example usage::
|
|
121
|
+
|
|
122
|
+
>>> axis.ticks.auto_spacing = True
|
|
123
|
+
"""
|
|
124
|
+
return self.axis._get_style(bool, sv.AUTOGRID)
|
|
125
|
+
|
|
126
|
+
@auto_spacing.setter
|
|
127
|
+
def auto_spacing(self, value):
|
|
128
|
+
self.axis._set_style(bool(value), sv.AUTOGRID)
|
|
129
|
+
|
|
130
|
+
@property
|
|
131
|
+
def spacing(self):
|
|
132
|
+
"""`float` (axis data units): Distance between major ticks.
|
|
133
|
+
|
|
134
|
+
The ``auto_spacing`` attribute must be set to `False`::
|
|
135
|
+
|
|
136
|
+
>>> axis.ticks.auto_spacing = False
|
|
137
|
+
>>> axis.ticks.spacing = 0.2
|
|
138
|
+
"""
|
|
139
|
+
return self.axis._get_style(float, sv.GRSPACING)
|
|
140
|
+
|
|
141
|
+
@spacing.setter
|
|
142
|
+
def spacing(self, value):
|
|
143
|
+
self.axis._set_style(float(value), sv.GRSPACING)
|
|
144
|
+
|
|
145
|
+
@property
|
|
146
|
+
def spacing_anchor(self):
|
|
147
|
+
"""`float`: Value to place the first major tick mark.
|
|
148
|
+
|
|
149
|
+
All ticks will placed around this anchor position::
|
|
150
|
+
|
|
151
|
+
>>> axis.ticks.spacing_anchor = 0.05
|
|
152
|
+
"""
|
|
153
|
+
return self.axis._get_style(float, sv.GRANCHOR)
|
|
154
|
+
|
|
155
|
+
@spacing_anchor.setter
|
|
156
|
+
def spacing_anchor(self, value):
|
|
157
|
+
self.axis._set_style(float(value), sv.GRANCHOR)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class Ticks2D(Ticks):
|
|
161
|
+
"""Tick marks (major and minor) along axes in 2D.
|
|
162
|
+
|
|
163
|
+
.. code-block:: python
|
|
164
|
+
:emphasize-lines: 25-26,29-33
|
|
165
|
+
|
|
166
|
+
import tecplot as tp
|
|
167
|
+
from os import path
|
|
168
|
+
from tecplot.constant import PlotType, AxisMode, AxisAlignment, TickDirection
|
|
169
|
+
|
|
170
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
171
|
+
infile = path.join(examples_dir, 'SimpleData', 'CircularContour.plt')
|
|
172
|
+
dataset = tp.data.load_tecplot(infile)
|
|
173
|
+
|
|
174
|
+
frame = tp.active_frame()
|
|
175
|
+
plot = frame.plot(PlotType.Cartesian2D)
|
|
176
|
+
|
|
177
|
+
plot.show_contour = True
|
|
178
|
+
plot.contour(0).colormap_name = 'Sequential - Yellow/Green/Blue'
|
|
179
|
+
|
|
180
|
+
plot.axes.x_axis.line.show = False
|
|
181
|
+
|
|
182
|
+
yaxis = plot.axes.y_axis
|
|
183
|
+
yaxis.max = 0.15
|
|
184
|
+
yaxis.line.show = False
|
|
185
|
+
yaxis.line.alignment = AxisAlignment.WithOpposingAxisValue
|
|
186
|
+
yaxis.line.opposing_axis_value = 0
|
|
187
|
+
yaxis.tick_labels.transparent_background = True
|
|
188
|
+
yaxis.tick_labels.offset = -5
|
|
189
|
+
|
|
190
|
+
yticks = yaxis.ticks
|
|
191
|
+
yticks.direction = TickDirection.Centered
|
|
192
|
+
|
|
193
|
+
for ticks in [plot.axes.x_axis.ticks, yticks]:
|
|
194
|
+
ticks.auto_spacing = False
|
|
195
|
+
ticks.spacing = 0.5
|
|
196
|
+
ticks.minor_num_ticks = 3
|
|
197
|
+
ticks.length *= 3
|
|
198
|
+
ticks.line_thickness *= 2
|
|
199
|
+
|
|
200
|
+
plot.view.fit()
|
|
201
|
+
|
|
202
|
+
# ensure consistent output between interactive (connected) and batch
|
|
203
|
+
plot.contour(0).levels.reset_to_nice()
|
|
204
|
+
|
|
205
|
+
tp.export.save_png('ticks_2d.png', 600, supersample=3)
|
|
206
|
+
|
|
207
|
+
.. figure:: /_static/images/ticks_2d.png
|
|
208
|
+
:width: 300px
|
|
209
|
+
:figwidth: 300px
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
@property
|
|
213
|
+
def show_on_border_min(self):
|
|
214
|
+
"""`bool`: Draw ticks along the lower border of the axes grid.
|
|
215
|
+
|
|
216
|
+
Example usage::
|
|
217
|
+
|
|
218
|
+
>>> axis.ticks.show_on_border_min = True
|
|
219
|
+
"""
|
|
220
|
+
return self._get_style(bool, sv.SHOWONGRIDBORDERMIN)
|
|
221
|
+
|
|
222
|
+
@show_on_border_min.setter
|
|
223
|
+
def show_on_border_min(self, value):
|
|
224
|
+
self._set_style(bool(value), sv.SHOWONGRIDBORDERMIN)
|
|
225
|
+
|
|
226
|
+
@property
|
|
227
|
+
def show_on_border_max(self):
|
|
228
|
+
"""`bool`: Draw ticks along the upper border of the axes grid.
|
|
229
|
+
|
|
230
|
+
Example usage::
|
|
231
|
+
|
|
232
|
+
>>> axis.ticks.show_on_border_max = True
|
|
233
|
+
"""
|
|
234
|
+
return self._get_style(bool, sv.SHOWONGRIDBORDERMAX)
|
|
235
|
+
|
|
236
|
+
@show_on_border_max.setter
|
|
237
|
+
def show_on_border_max(self, value):
|
|
238
|
+
self._set_style(bool(value), sv.SHOWONGRIDBORDERMAX)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class RadialTicks(Ticks2D):
|
|
242
|
+
"""Tick marks (major and minor) along the radial axis.
|
|
243
|
+
|
|
244
|
+
.. code-block:: python
|
|
245
|
+
:emphasize-lines: 18-21
|
|
246
|
+
|
|
247
|
+
from os import path
|
|
248
|
+
import tecplot as tp
|
|
249
|
+
from tecplot.constant import PlotType, ThetaMode, Color, TickDirection
|
|
250
|
+
|
|
251
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
252
|
+
datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
|
|
253
|
+
dataset = tp.load_layout(datafile)
|
|
254
|
+
|
|
255
|
+
plot = tp.active_frame().plot(PlotType.PolarLine)
|
|
256
|
+
plot.activate()
|
|
257
|
+
|
|
258
|
+
plot.axes.theta_axis.mode = ThetaMode.Radians
|
|
259
|
+
|
|
260
|
+
raxis = plot.axes.r_axis
|
|
261
|
+
raxis.line.color = Color.Red
|
|
262
|
+
raxis.tick_labels.offset = -4
|
|
263
|
+
|
|
264
|
+
raxis.ticks.direction =TickDirection.Centered
|
|
265
|
+
raxis.ticks.line_thickness = 0.8
|
|
266
|
+
raxis.ticks.length = 4
|
|
267
|
+
raxis.ticks.minor_length = 4
|
|
268
|
+
|
|
269
|
+
tp.export.save_png('ticks_radial.png', 600, supersample=3)
|
|
270
|
+
|
|
271
|
+
.. figure:: /_static/images/ticks_radial.png
|
|
272
|
+
:width: 300px
|
|
273
|
+
:figwidth: 300px
|
|
274
|
+
"""
|
|
275
|
+
|
|
276
|
+
@property
|
|
277
|
+
def show_on_all_radial_axes(self):
|
|
278
|
+
"""`bool`: Draw ticks along all radial axis lines.
|
|
279
|
+
|
|
280
|
+
Example usage::
|
|
281
|
+
|
|
282
|
+
>>> plot.axes.r_axis.line.show_perpendicular = True
|
|
283
|
+
>>> plot.axes.r_axis.ticks.show_on_all_radial_axes = True
|
|
284
|
+
"""
|
|
285
|
+
return self._get_style(bool, sv.SHOWONALLAXES)
|
|
286
|
+
|
|
287
|
+
@show_on_all_radial_axes.setter
|
|
288
|
+
def show_on_all_radial_axes(self, value):
|
|
289
|
+
self._set_style(bool(value), sv.SHOWONALLAXES)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
class Ticks3D(Ticks):
|
|
293
|
+
"""Tick marks (major and minor) along axes in 3D.
|
|
294
|
+
|
|
295
|
+
.. code-block:: python
|
|
296
|
+
:emphasize-lines: 21-22
|
|
297
|
+
|
|
298
|
+
from os import path
|
|
299
|
+
import tecplot as tp
|
|
300
|
+
from tecplot.constant import PlotType, TickDirection
|
|
301
|
+
|
|
302
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
303
|
+
infile = path.join(examples_dir, 'SimpleData', 'F18.plt')
|
|
304
|
+
dataset = tp.data.load_tecplot(infile)
|
|
305
|
+
|
|
306
|
+
frame = tp.active_frame()
|
|
307
|
+
plot = frame.plot(PlotType.Cartesian3D)
|
|
308
|
+
plot.activate()
|
|
309
|
+
|
|
310
|
+
plot.show_contour = True
|
|
311
|
+
plot.contour(0).legend.show = False
|
|
312
|
+
plot.axes.grid_area.filled = False
|
|
313
|
+
|
|
314
|
+
for axis in plot.axes:
|
|
315
|
+
axis.show = True
|
|
316
|
+
axis.grid_lines.show = False
|
|
317
|
+
|
|
318
|
+
axis.ticks.length *= 4
|
|
319
|
+
axis.ticks.minor_length *= 4
|
|
320
|
+
|
|
321
|
+
plot.view.fit()
|
|
322
|
+
|
|
323
|
+
tp.export.save_png('ticks_3d.png', 600, supersample=3)
|
|
324
|
+
|
|
325
|
+
.. figure:: /_static/images/ticks_3d.png
|
|
326
|
+
:width: 300px
|
|
327
|
+
:figwidth: 300px
|
|
328
|
+
"""
|
|
329
|
+
|
|
330
|
+
@property
|
|
331
|
+
def show_on_opposite_edge(self):
|
|
332
|
+
"""`bool`: Draw ticks along the opposite border of the axes grid.
|
|
333
|
+
|
|
334
|
+
Example usage::
|
|
335
|
+
|
|
336
|
+
>>> axis.ticks.show_on_opposite_edge = True
|
|
337
|
+
"""
|
|
338
|
+
return self._get_style(bool, sv.SHOWONOPPOSITEEDGE)
|
|
339
|
+
|
|
340
|
+
@show_on_opposite_edge.setter
|
|
341
|
+
def show_on_opposite_edge(self, value):
|
|
342
|
+
self._set_style(bool(value), sv.SHOWONOPPOSITEEDGE)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
class TickLabels(session.Style):
|
|
346
|
+
def __init__(self, axis):
|
|
347
|
+
self.axis = axis
|
|
348
|
+
super().__init__(axis._sv, sv.TICKLABEL, **axis._kw)
|
|
349
|
+
|
|
350
|
+
@property
|
|
351
|
+
def show(self):
|
|
352
|
+
"""`bool`: Draw labels for the major tick marks.
|
|
353
|
+
|
|
354
|
+
Example usage::
|
|
355
|
+
|
|
356
|
+
>>> axis.tick_labels.show = True
|
|
357
|
+
"""
|
|
358
|
+
return self._get_style(bool, sv.SHOWONAXISLINE)
|
|
359
|
+
|
|
360
|
+
@show.setter
|
|
361
|
+
def show(self, value):
|
|
362
|
+
self._set_style(bool(value), sv.SHOWONAXISLINE)
|
|
363
|
+
|
|
364
|
+
@property
|
|
365
|
+
def alignment(self):
|
|
366
|
+
"""`float` (degrees) or `LabelAlignment`: Angle at which to render the label text.
|
|
367
|
+
|
|
368
|
+
Possible values: `LabelAlignment.ByAngle`, `LabelAlignment.AlongAxis`
|
|
369
|
+
or `LabelAlignment.PerpendicularToAxis`.
|
|
370
|
+
|
|
371
|
+
Example usage::
|
|
372
|
+
|
|
373
|
+
>>> from tecplot.constant import LabelAlignment
|
|
374
|
+
>>> axis.tick_labels.alignment = LabelAlignment.AlongAxis
|
|
375
|
+
"""
|
|
376
|
+
return self._get_style(LabelAlignment, sv.LABELALIGNMENT)
|
|
377
|
+
|
|
378
|
+
@alignment.setter
|
|
379
|
+
def alignment(self, value):
|
|
380
|
+
self._set_style(LabelAlignment(value), sv.LABELALIGNMENT)
|
|
381
|
+
|
|
382
|
+
@property
|
|
383
|
+
def angle(self):
|
|
384
|
+
"""`float` (degrees): Angle at which to render the label text.
|
|
385
|
+
|
|
386
|
+
The ``alignment`` attribute must be set to `LabelAlignment.ByAngle`::
|
|
387
|
+
|
|
388
|
+
>>> from tecplot.constant import LabelAlignment
|
|
389
|
+
>>> axis.tick_labels.alignment = LabelAlignment.ByAngle
|
|
390
|
+
>>> axis.tick_labels.angle = 30
|
|
391
|
+
"""
|
|
392
|
+
return self._get_style(float, sv.ANGLE)
|
|
393
|
+
|
|
394
|
+
@angle.setter
|
|
395
|
+
def angle(self, value):
|
|
396
|
+
self._set_style(float(value), sv.ANGLE)
|
|
397
|
+
|
|
398
|
+
@property
|
|
399
|
+
def color(self):
|
|
400
|
+
"""`Color`: Color of the tick labels.
|
|
401
|
+
|
|
402
|
+
Example usage::
|
|
403
|
+
|
|
404
|
+
>>> from tecplot.constant import Color
|
|
405
|
+
>>> axis.tick_labels.color = Color.Blue
|
|
406
|
+
"""
|
|
407
|
+
return self._get_style(Color, sv.COLOR)
|
|
408
|
+
|
|
409
|
+
@color.setter
|
|
410
|
+
def color(self, value):
|
|
411
|
+
self._set_style(Color(value), sv.COLOR)
|
|
412
|
+
|
|
413
|
+
@property
|
|
414
|
+
def offset(self):
|
|
415
|
+
"""`float`: Relative offset of the tick labels.
|
|
416
|
+
|
|
417
|
+
Positive values will be outside the grid area, negative values are
|
|
418
|
+
inside the grid area::
|
|
419
|
+
|
|
420
|
+
>>> axis.tick_labels.offset = 5
|
|
421
|
+
"""
|
|
422
|
+
return self._get_style(float, sv.OFFSET)
|
|
423
|
+
|
|
424
|
+
@offset.setter
|
|
425
|
+
def offset(self, value):
|
|
426
|
+
self._set_style(float(value), sv.OFFSET)
|
|
427
|
+
|
|
428
|
+
@property
|
|
429
|
+
def step(self):
|
|
430
|
+
"""`int`: Step for labels placed on major ticks.
|
|
431
|
+
|
|
432
|
+
A value of 1 will place a label on every major tick mark::
|
|
433
|
+
|
|
434
|
+
>>> axis.tick_labels.step = 1
|
|
435
|
+
"""
|
|
436
|
+
return self._get_style(int, sv.SKIP)
|
|
437
|
+
|
|
438
|
+
@step.setter
|
|
439
|
+
def step(self, value):
|
|
440
|
+
self._set_style(int(value), sv.SKIP)
|
|
441
|
+
|
|
442
|
+
@property
|
|
443
|
+
def format(self):
|
|
444
|
+
"""`LabelFormat`: Label format and style control.
|
|
445
|
+
|
|
446
|
+
Example usage::
|
|
447
|
+
|
|
448
|
+
>>> axis.tick_labels.format.format_type = NumberFormat.BestFloat
|
|
449
|
+
"""
|
|
450
|
+
return LabelFormat(self)
|
|
451
|
+
|
|
452
|
+
@property
|
|
453
|
+
def font(self):
|
|
454
|
+
"""`text.Font`: Text style control including typeface and size.
|
|
455
|
+
|
|
456
|
+
Example usage::
|
|
457
|
+
|
|
458
|
+
>>> axis.tick_labels.font.typeface = 'Times'
|
|
459
|
+
"""
|
|
460
|
+
return Font(self)
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
class TickLabels2D(TickLabels):
|
|
464
|
+
"""Tick labels along axes in 2D.
|
|
465
|
+
|
|
466
|
+
.. code-block:: python
|
|
467
|
+
|
|
468
|
+
from datetime import datetime
|
|
469
|
+
import tecplot as tp
|
|
470
|
+
from tecplot.constant import (PlotType, AxisMode, AxisAlignment, NumberFormat,
|
|
471
|
+
Color)
|
|
472
|
+
|
|
473
|
+
# tecplot dates are in days after Midnight, Dec 30, 1899
|
|
474
|
+
origin = datetime(1899, 12, 30)
|
|
475
|
+
start = (datetime(1955, 11, 5) - origin).days
|
|
476
|
+
stop = (datetime(1985, 10, 26) - origin).days
|
|
477
|
+
|
|
478
|
+
tp.new_layout()
|
|
479
|
+
plot = tp.active_frame().plot(tp.constant.PlotType.Sketch)
|
|
480
|
+
plot.activate()
|
|
481
|
+
|
|
482
|
+
plot.axes.viewport.left = 15
|
|
483
|
+
plot.axes.viewport.right = 95
|
|
484
|
+
|
|
485
|
+
xaxis = plot.axes.x_axis
|
|
486
|
+
xaxis.show = True
|
|
487
|
+
xaxis.min, xaxis.max = start, stop
|
|
488
|
+
xaxis.line.alignment = AxisAlignment.WithViewport
|
|
489
|
+
xaxis.line.position = 50
|
|
490
|
+
xaxis.ticks.auto_spacing = False
|
|
491
|
+
xaxis.ticks.spacing = (stop - start) // 4
|
|
492
|
+
xaxis.ticks.spacing_anchor = start
|
|
493
|
+
|
|
494
|
+
xaxis.tick_labels.format.format_type = NumberFormat.TimeDate
|
|
495
|
+
xaxis.tick_labels.format.datetime_format = 'mmm d, yyyy'
|
|
496
|
+
xaxis.tick_labels.color = Color.Blue
|
|
497
|
+
xaxis.tick_labels.angle = 45
|
|
498
|
+
|
|
499
|
+
tp.export.save_png('tick_labels_2d.png', 600, supersample=3)
|
|
500
|
+
|
|
501
|
+
.. figure:: /_static/images/tick_labels_2d.png
|
|
502
|
+
:width: 300px
|
|
503
|
+
:figwidth: 300px
|
|
504
|
+
"""
|
|
505
|
+
|
|
506
|
+
@property
|
|
507
|
+
def show_on_border_max(self):
|
|
508
|
+
"""`bool`: Draw labels along the upper grid area border.
|
|
509
|
+
|
|
510
|
+
Example usage::
|
|
511
|
+
|
|
512
|
+
>>> axis.tick_labels.show_on_border_max = True
|
|
513
|
+
"""
|
|
514
|
+
return self._get_style(bool, sv.SHOWONGRIDBORDERMAX)
|
|
515
|
+
|
|
516
|
+
@show_on_border_max.setter
|
|
517
|
+
def show_on_border_max(self, value):
|
|
518
|
+
self._set_style(bool(value), sv.SHOWONGRIDBORDERMAX)
|
|
519
|
+
|
|
520
|
+
@property
|
|
521
|
+
def show_on_border_min(self):
|
|
522
|
+
"""`bool`: Draw labels along the lower grid area border.
|
|
523
|
+
|
|
524
|
+
Example usage::
|
|
525
|
+
|
|
526
|
+
>>> axis.tick_labels.show_on_border_min = True
|
|
527
|
+
"""
|
|
528
|
+
return self._get_style(bool, sv.SHOWONGRIDBORDERMIN)
|
|
529
|
+
|
|
530
|
+
@show_on_border_min.setter
|
|
531
|
+
def show_on_border_min(self, value):
|
|
532
|
+
self._set_style(bool(value), sv.SHOWONGRIDBORDERMIN)
|
|
533
|
+
|
|
534
|
+
@property
|
|
535
|
+
def show_at_axis_intersection(self):
|
|
536
|
+
"""`bool`: Include the labels at the intersection of other axes.
|
|
537
|
+
|
|
538
|
+
Example usage::
|
|
539
|
+
|
|
540
|
+
>>> axis.tick_labels.show_at_axis_intersection = True
|
|
541
|
+
"""
|
|
542
|
+
return self._get_style(bool, sv.SHOWATAXISINTERSECTION)
|
|
543
|
+
|
|
544
|
+
@show_at_axis_intersection.setter
|
|
545
|
+
def show_at_axis_intersection(self, value):
|
|
546
|
+
self._set_style(bool(value), sv.SHOWATAXISINTERSECTION)
|
|
547
|
+
|
|
548
|
+
@property
|
|
549
|
+
def transparent_background(self):
|
|
550
|
+
"""`bool`: Make the text box around each label transparent.
|
|
551
|
+
|
|
552
|
+
Example usage::
|
|
553
|
+
|
|
554
|
+
>>> axis.tick_labels.transparent_background = True
|
|
555
|
+
"""
|
|
556
|
+
return not self._get_style(bool, sv.ERASEBEHINDLABELS)
|
|
557
|
+
|
|
558
|
+
@transparent_background.setter
|
|
559
|
+
def transparent_background(self, value):
|
|
560
|
+
self._set_style(not bool(value), sv.ERASEBEHINDLABELS)
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
class RadialTickLabels(TickLabels2D):
|
|
564
|
+
"""Tick mark labels along the radial axis.
|
|
565
|
+
|
|
566
|
+
.. code-block:: python
|
|
567
|
+
:emphasize-lines: 16-18
|
|
568
|
+
|
|
569
|
+
from os import path
|
|
570
|
+
import tecplot as tp
|
|
571
|
+
from tecplot.constant import PlotType, ThetaMode, Color
|
|
572
|
+
|
|
573
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
574
|
+
datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
|
|
575
|
+
dataset = tp.load_layout(datafile)
|
|
576
|
+
|
|
577
|
+
plot = tp.active_frame().plot(PlotType.PolarLine)
|
|
578
|
+
plot.activate()
|
|
579
|
+
|
|
580
|
+
plot.axes.theta_axis.mode = ThetaMode.Radians
|
|
581
|
+
|
|
582
|
+
raxis = plot.axes.r_axis
|
|
583
|
+
raxis.line.color = Color.Red
|
|
584
|
+
raxis.tick_labels.offset = -4
|
|
585
|
+
raxis.tick_labels.color = Color.Red
|
|
586
|
+
raxis.tick_labels.font.bold = True
|
|
587
|
+
|
|
588
|
+
tp.export.save_png('tick_labels_radial.png', 600, supersample=3)
|
|
589
|
+
|
|
590
|
+
.. figure:: /_static/images/tick_labels_radial.png
|
|
591
|
+
:width: 300px
|
|
592
|
+
:figwidth: 300px
|
|
593
|
+
"""
|
|
594
|
+
|
|
595
|
+
@property
|
|
596
|
+
def show_on_all_radial_axes(self):
|
|
597
|
+
"""`bool`: Draw labels along all radial axis lines.
|
|
598
|
+
|
|
599
|
+
Example usage::
|
|
600
|
+
|
|
601
|
+
>>> plot.axes.r_axis.line.show_perpendicular = True
|
|
602
|
+
>>> plot.axes.r_axis.tick_labels.show_on_all_radial_axes = True
|
|
603
|
+
"""
|
|
604
|
+
return self._get_style(bool, sv.SHOWONALLAXES)
|
|
605
|
+
|
|
606
|
+
@show_on_all_radial_axes.setter
|
|
607
|
+
def show_on_all_radial_axes(self, value):
|
|
608
|
+
self._set_style(bool(value), sv.SHOWONALLAXES)
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
class TickLabels3D(TickLabels):
|
|
612
|
+
"""Tick labels along axes in 3D.
|
|
613
|
+
|
|
614
|
+
.. code-block:: python
|
|
615
|
+
:emphasize-lines: 23-27
|
|
616
|
+
|
|
617
|
+
from os import path
|
|
618
|
+
import tecplot as tp
|
|
619
|
+
from tecplot.constant import PlotType, Color
|
|
620
|
+
|
|
621
|
+
examples_dir = tp.session.tecplot_examples_directory()
|
|
622
|
+
infile = path.join(examples_dir, 'SimpleData', 'F18.plt')
|
|
623
|
+
dataset = tp.data.load_tecplot(infile)
|
|
624
|
+
|
|
625
|
+
frame = tp.active_frame()
|
|
626
|
+
plot = frame.plot(PlotType.Cartesian3D)
|
|
627
|
+
plot.activate()
|
|
628
|
+
|
|
629
|
+
plot.show_contour = True
|
|
630
|
+
plot.contour(0).legend.show = False
|
|
631
|
+
|
|
632
|
+
for ax in [plot.axes.x_axis, plot.axes.y_axis]:
|
|
633
|
+
xaxis = plot.axes.x_axis
|
|
634
|
+
ax.show = True
|
|
635
|
+
ax.title.show = False
|
|
636
|
+
ax.line.show_on_opposite_edge = True
|
|
637
|
+
ax.ticks.show_on_opposite_edge = True
|
|
638
|
+
|
|
639
|
+
ax.tick_labels.color = Color.Blue
|
|
640
|
+
ax.tick_labels.show_on_opposite_edge = True
|
|
641
|
+
ax.tick_labels.font.typeface = 'Times'
|
|
642
|
+
ax.tick_labels.font.size = 8
|
|
643
|
+
ax.tick_labels.font.italic = True
|
|
644
|
+
|
|
645
|
+
plot.view.fit()
|
|
646
|
+
|
|
647
|
+
tp.export.save_png('tick_labels_3d.png', 600, supersample=3)
|
|
648
|
+
|
|
649
|
+
.. figure:: /_static/images/tick_labels_3d.png
|
|
650
|
+
:width: 300px
|
|
651
|
+
:figwidth: 300px
|
|
652
|
+
"""
|
|
653
|
+
|
|
654
|
+
@property
|
|
655
|
+
def show_on_opposite_edge(self):
|
|
656
|
+
"""`bool`: Draw labels on the opposite edge of the grid.
|
|
657
|
+
|
|
658
|
+
Example usage::
|
|
659
|
+
|
|
660
|
+
>>> axis.tick_labels.show_on_opposite_edge = True
|
|
661
|
+
"""
|
|
662
|
+
return self._get_style(bool, sv.SHOWONOPPOSITEEDGE)
|
|
663
|
+
|
|
664
|
+
@show_on_opposite_edge.setter
|
|
665
|
+
def show_on_opposite_edge(self, value):
|
|
666
|
+
self._set_style(bool(value), sv.SHOWONOPPOSITEEDGE)
|