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.
Files changed (97) hide show
  1. pytecplot-1.5.2.dist-info/LICENSE.html +77 -0
  2. pytecplot-1.5.2.dist-info/METADATA +508 -0
  3. pytecplot-1.5.2.dist-info/RECORD +97 -0
  4. pytecplot-1.5.2.dist-info/WHEEL +5 -0
  5. pytecplot-1.5.2.dist-info/top_level.txt +1 -0
  6. tecplot/__init__.py +94 -0
  7. tecplot/annotation/__init__.py +7 -0
  8. tecplot/annotation/annotation.py +223 -0
  9. tecplot/annotation/geometry.py +369 -0
  10. tecplot/annotation/georeference.py +33 -0
  11. tecplot/annotation/image.py +185 -0
  12. tecplot/annotation/iter.py +105 -0
  13. tecplot/annotation/polyline.py +381 -0
  14. tecplot/annotation/text.py +744 -0
  15. tecplot/constant.py +401 -0
  16. tecplot/data/__init__.py +34 -0
  17. tecplot/data/array.py +645 -0
  18. tecplot/data/create.py +1 -0
  19. tecplot/data/dataset.py +1809 -0
  20. tecplot/data/extract.py +544 -0
  21. tecplot/data/face_neighbors.py +494 -0
  22. tecplot/data/facemap.py +814 -0
  23. tecplot/data/load.py +2075 -0
  24. tecplot/data/nodemap.py +577 -0
  25. tecplot/data/operate.py +928 -0
  26. tecplot/data/query.py +334 -0
  27. tecplot/data/save.py +343 -0
  28. tecplot/data/variable.py +280 -0
  29. tecplot/data/zone.py +841 -0
  30. tecplot/exception.py +201 -0
  31. tecplot/export/__init__.py +13 -0
  32. tecplot/export/animation.py +521 -0
  33. tecplot/export/export_setup.py +318 -0
  34. tecplot/export/image.py +577 -0
  35. tecplot/export/print_setup.py +218 -0
  36. tecplot/export/time_animation.py +607 -0
  37. tecplot/extension/__init__.py +14 -0
  38. tecplot/extension/ipython.py +68 -0
  39. tecplot/layout/__init__.py +20 -0
  40. tecplot/layout/frame.py +1285 -0
  41. tecplot/layout/layout.py +488 -0
  42. tecplot/layout/page.py +541 -0
  43. tecplot/legend/__init__.py +4 -0
  44. tecplot/legend/contour_legend.py +516 -0
  45. tecplot/legend/legend.py +141 -0
  46. tecplot/legend/line_legend.py +66 -0
  47. tecplot/legend/rgb_coloring_legend.py +291 -0
  48. tecplot/legend/scatter_legend.py +136 -0
  49. tecplot/macro.py +339 -0
  50. tecplot/plot/__init__.py +62 -0
  51. tecplot/plot/axes.py +881 -0
  52. tecplot/plot/axis.py +1350 -0
  53. tecplot/plot/blanking.py +584 -0
  54. tecplot/plot/contour.py +1302 -0
  55. tecplot/plot/effects.py +162 -0
  56. tecplot/plot/fieldmap.py +2159 -0
  57. tecplot/plot/grid.py +758 -0
  58. tecplot/plot/isosurface.py +1167 -0
  59. tecplot/plot/labels.py +338 -0
  60. tecplot/plot/linemap.py +1905 -0
  61. tecplot/plot/linking.py +489 -0
  62. tecplot/plot/plot.py +1791 -0
  63. tecplot/plot/rgb_coloring.py +281 -0
  64. tecplot/plot/scatter.py +396 -0
  65. tecplot/plot/slice.py +1544 -0
  66. tecplot/plot/streamtrace.py +1949 -0
  67. tecplot/plot/symbol.py +567 -0
  68. tecplot/plot/ticks.py +666 -0
  69. tecplot/plot/title.py +380 -0
  70. tecplot/plot/vector.py +679 -0
  71. tecplot/plot/view.py +868 -0
  72. tecplot/session/__init__.py +112 -0
  73. tecplot/session/aux_data.py +276 -0
  74. tecplot/session/config.py +92 -0
  75. tecplot/session/session.py +425 -0
  76. tecplot/session/state_changed.py +225 -0
  77. tecplot/session/style.py +504 -0
  78. tecplot/tecutil/__init__.py +16 -0
  79. tecplot/tecutil/arglist.py +230 -0
  80. tecplot/tecutil/captured_output.py +177 -0
  81. tecplot/tecutil/constant.py +1312 -0
  82. tecplot/tecutil/index_set.py +118 -0
  83. tecplot/tecutil/lock.py +36 -0
  84. tecplot/tecutil/message_pb2.py +39 -0
  85. tecplot/tecutil/preamble.py +54 -0
  86. tecplot/tecutil/stringlist.py +114 -0
  87. tecplot/tecutil/sv.py +1662 -0
  88. tecplot/tecutil/tecutil.py +12402 -0
  89. tecplot/tecutil/tecutil_client.py +627 -0
  90. tecplot/tecutil/tecutil_connector.py +937 -0
  91. tecplot/tecutil/tecutil_rpc.py +6845 -0
  92. tecplot/tecutil/util.py +332 -0
  93. tecplot/text/__init__.py +3 -0
  94. tecplot/text/font.py +224 -0
  95. tecplot/text/label_format.py +374 -0
  96. tecplot/text/textbox.py +106 -0
  97. tecplot/version.py +41 -0
tecplot/plot/grid.py ADDED
@@ -0,0 +1,758 @@
1
+ from builtins import super
2
+
3
+ from ..constant import *
4
+ from .. import session
5
+ from ..tecutil import sv
6
+
7
+
8
+ class GridArea(session.Style):
9
+ """Grid area for polar 2D plots.
10
+
11
+ .. code-block:: python
12
+ :emphasize-lines: 15-18
13
+
14
+ from os import path
15
+ import tecplot as tp
16
+ from tecplot.constant import PlotType, ThetaMode, Color
17
+
18
+ examples_dir = tp.session.tecplot_examples_directory()
19
+ datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
20
+ dataset = tp.load_layout(datafile)
21
+
22
+ plot = tp.active_frame().plot(PlotType.PolarLine)
23
+ plot.activate()
24
+
25
+ plot.axes.theta_axis.mode = ThetaMode.Radians
26
+ plot.axes.grid_area.fill_color = Color.Creme
27
+
28
+ grid_area = plot.axes.grid_area
29
+ grid_area.filled = True
30
+ grid_area.fill_color = Color.SkyBlue
31
+ grid_area.show_border = True
32
+
33
+ tp.export.save_png('grid_area_polar.png', 600, supersample=3)
34
+
35
+ .. figure:: /_static/images/grid_area_polar.png
36
+ :width: 300px
37
+ :figwidth: 300px
38
+ """
39
+
40
+ def __init__(self, axes):
41
+ self.axes = axes
42
+ super().__init__(axes._sv, sv.GRIDAREA, **axes._kw)
43
+
44
+ @property
45
+ def filled(self):
46
+ """`bool`: Fill the axes area background color.
47
+
48
+ Example usage::
49
+
50
+ >>> from tecplot.constant import Color
51
+ >>> plot.axes.grid_area.filled = True
52
+ >>> plot.axes.grid_area.fill_color = Color.LightGreen
53
+ """
54
+ return self._get_style(bool, sv.ISFILLED)
55
+
56
+ @filled.setter
57
+ def filled(self, value):
58
+ self._set_style(bool(value), sv.ISFILLED)
59
+
60
+ @property
61
+ def fill_color(self):
62
+ """`Color`: Axes area background color.
63
+
64
+ This requires the ``filled`` attribute to be `True`::
65
+
66
+ >>> from tecplot.constant import Color
67
+ >>> plot.axes.grid_area.filled = True
68
+ >>> plot.axes.grid_area.fill_color = Color.LightGreen
69
+ """
70
+ return self._get_style(Color, sv.FILLCOLOR)
71
+
72
+ @fill_color.setter
73
+ def fill_color(self, value):
74
+ self._set_style(Color(value), sv.FILLCOLOR)
75
+
76
+ @property
77
+ def show_border(self):
78
+ """`bool`: Draw border around axes area.
79
+
80
+ Example usage::
81
+
82
+ >>> plot.axes.grid_area.show_border = True
83
+ """
84
+ return self._get_style(bool, sv.DRAWBORDER)
85
+
86
+ @show_border.setter
87
+ def show_border(self, value):
88
+ self._set_style(bool(value), sv.DRAWBORDER)
89
+
90
+
91
+ class Cartesian2DGridArea(GridArea):
92
+ """Grid area for cartesian 2D plots.
93
+
94
+ .. code-block:: python
95
+ :emphasize-lines: 15-18
96
+
97
+ from os import path
98
+ import tecplot as tp
99
+ from tecplot.constant import PlotType, Color
100
+
101
+ examples_dir = tp.session.tecplot_examples_directory()
102
+ infile = path.join(examples_dir, 'SimpleData', 'SunSpots.plt')
103
+ dataset = tp.data.load_tecplot(infile)
104
+
105
+ frame = tp.active_frame()
106
+ plot = frame.plot(PlotType.XYLine)
107
+
108
+ plot.linemap(0).line.color = Color.DarkBlue
109
+ plot.linemap(0).line.line_thickness = 1.0
110
+
111
+ grid_area = plot.axes.grid_area
112
+ grid_area.filled = True
113
+ grid_area.fill_color = Color.SkyBlue
114
+ grid_area.show_border = True
115
+
116
+ tp.export.save_png('grid_area_2d.png', 600, supersample=3)
117
+
118
+ .. figure:: /_static/images/grid_area_2d.png
119
+ :width: 300px
120
+ :figwidth: 300px
121
+ """
122
+
123
+ @property
124
+ def border_color(self):
125
+ """`Color`: Border line color.
126
+
127
+ Example usage::
128
+
129
+ >>> from tecplot.constant import Color
130
+ >>> plot.axes.grid_area.show_border = True
131
+ >>> plot.axes.grid_area.border_color = Color.LightGreen
132
+ """
133
+ return self._get_style(Color, sv.COLOR)
134
+
135
+ @border_color.setter
136
+ def border_color(self, value):
137
+ self._set_style(Color(value), sv.COLOR)
138
+
139
+ @property
140
+ def border_thickness(self):
141
+ """`float`: Width of the border lines to be drawn.
142
+
143
+ Example usage::
144
+
145
+ >>> plot.axes.grid_area.border_thickness = 0.5
146
+ """
147
+ return self._get_style(float, sv.LINETHICKNESS)
148
+
149
+ @border_thickness.setter
150
+ def border_thickness(self, value):
151
+ self._set_style(float(value), sv.LINETHICKNESS)
152
+
153
+
154
+ class Cartesian3DGridArea(GridArea):
155
+ """Grid area for 3D field plots.
156
+
157
+ .. code-block:: python
158
+ :emphasize-lines: 21-24
159
+
160
+ from os import path
161
+ import tecplot as tp
162
+ from tecplot.constant import PlotType, SurfacesToPlot, Color
163
+
164
+ examples_dir = tp.session.tecplot_examples_directory()
165
+ infile = path.join(examples_dir, 'SimpleData', 'Pyramid.plt')
166
+ dataset = tp.data.load_tecplot(infile)
167
+
168
+ frame = tp.active_frame()
169
+ plot = frame.plot(PlotType.Cartesian3D)
170
+
171
+ fmaps = plot.fieldmaps()
172
+ fmaps.contour.show = True
173
+ fmaps.surfaces.surfaces_to_plot = SurfacesToPlot.BoundaryFaces
174
+ plot.show_contour = True
175
+ plot.contour(0).legend.show = False
176
+
177
+ for axis in plot.axes:
178
+ axis.show = True
179
+
180
+ grid_area = plot.axes.grid_area
181
+ grid_area.fill_color = Color.SkyBlue
182
+ grid_area.show_border = True
183
+ grid_area.use_lighting_effect = True
184
+
185
+ plot.view.fit()
186
+
187
+ tp.export.save_png('grid_area_3d.png', 600, supersample=3)
188
+
189
+ .. figure:: /_static/images/grid_area_3d.png
190
+ :width: 300px
191
+ :figwidth: 300px
192
+ """
193
+
194
+ @property
195
+ def use_lighting_effect(self):
196
+ """`bool`: Enable lighting effect shading on grid area.
197
+
198
+ Example usage::
199
+
200
+ >>> plot.axes.grid_area.use_lighting_effect = True
201
+ """
202
+ return self._get_style(bool, sv.USELIGHTSOURCETOFILL)
203
+
204
+ @use_lighting_effect.setter
205
+ def use_lighting_effect(self, value):
206
+ self._set_style(bool(value), sv.USELIGHTSOURCETOFILL)
207
+
208
+
209
+ class PreciseGrid(session.Style):
210
+ """Grid of precise dots aligned with all tick marks.
211
+
212
+ .. code-block:: python
213
+ :emphasize-lines: 19-21
214
+
215
+ from os import path
216
+ import tecplot as tp
217
+ from tecplot.constant import PlotType, LinePattern, Color
218
+
219
+ examples_dir = tp.session.tecplot_examples_directory()
220
+ datafile = path.join(examples_dir, 'SimpleData', 'RainierElevation.plt')
221
+ dataset = tp.data.load_tecplot(datafile)
222
+
223
+ plot = tp.active_frame().plot(PlotType.Cartesian2D)
224
+ plot.activate()
225
+
226
+ plot.show_contour = True
227
+ plot.contour(0).colormap_name = 'Elevation - Above Ground Level'
228
+
229
+ xaxis = plot.axes.x_axis
230
+ plot.axes.preserve_scale = True
231
+ xaxis.max = xaxis.variable.values(0).max()
232
+
233
+ grid = plot.axes.precise_grid
234
+ grid.show = True
235
+ grid.size = 0.05
236
+
237
+ # ensure consistent output between interactive (connected) and batch
238
+ plot.contour(0).levels.reset_to_nice()
239
+
240
+ tp.export.save_png('precise_grid.png', 600, supersample=3)
241
+
242
+ .. figure:: /_static/images/precise_grid.png
243
+ :width: 300px
244
+ :figwidth: 300px
245
+ """
246
+ def __init__(self, axes):
247
+ self.axes = axes
248
+ super().__init__(axes._sv[-1], sv.PRECISEGRID, **axes._kw)
249
+
250
+ @property
251
+ def show(self):
252
+ """`bool`: Draw precise grid dots in axes area.
253
+
254
+ Example usage::
255
+
256
+ >>> plot.axes.precise_grid.show = True
257
+ """
258
+ return self._get_style(bool, sv.INCLUDE)
259
+
260
+ @show.setter
261
+ def show(self, value):
262
+ self._set_style(bool(value), sv.INCLUDE)
263
+
264
+ @property
265
+ def size(self):
266
+ """`float` (cm): Size of the dots for precise grid.
267
+
268
+ Example usage::
269
+
270
+ >>> plot.axes.precise_grid.size = 0.2
271
+ """
272
+ return self._get_style(float, sv.SIZE)
273
+
274
+ @size.setter
275
+ def size(self, value):
276
+ self._set_style(float(value), sv.SIZE)
277
+
278
+ @property
279
+ def color(self):
280
+ """`Color`: Color of the dots for precise grid.
281
+
282
+ Example usage::
283
+
284
+ >>> plot.axes.precise_grid.color = Color.DarkBlue
285
+ """
286
+ return self._get_style(Color, sv.COLOR)
287
+
288
+ @color.setter
289
+ def color(self, value):
290
+ self._set_style(Color(value), sv.COLOR)
291
+
292
+
293
+ class GridLinesStyle(session.Style):
294
+ def __init__(self, axis, *svargs):
295
+ self.axis = axis
296
+ super().__init__(axis._sv, *svargs, **axis._kw)
297
+
298
+ @property
299
+ def show(self):
300
+ """`bool`: Draw grid lines as tick locations.
301
+
302
+ Example usage::
303
+
304
+ >>> grid_lines.show = True
305
+ """
306
+ return self._get_style(bool, sv.SHOW)
307
+
308
+ @show.setter
309
+ def show(self, value):
310
+ self._set_style(bool(value), sv.SHOW)
311
+
312
+ @property
313
+ def color(self):
314
+ """`Color`: `Color` of the grid lines to be drawn.
315
+
316
+ Example usage::
317
+
318
+ >>> from tecplot.constant import Color
319
+ >>> grid_lines.color = Color.Blue
320
+ """
321
+ return self._get_style(Color, sv.COLOR)
322
+
323
+ @color.setter
324
+ def color(self, value):
325
+ self._set_style(Color(value), sv.COLOR)
326
+
327
+ @property
328
+ def line_thickness(self):
329
+ """`float`: Width of the grid lines to be drawn.
330
+
331
+ Example usage::
332
+
333
+ >>> grid_lines.line_thickness = 0.5
334
+ """
335
+ return self._get_style(float, sv.LINETHICKNESS)
336
+
337
+ @line_thickness.setter
338
+ def line_thickness(self, value):
339
+ self._set_style(float(value), sv.LINETHICKNESS)
340
+
341
+ @property
342
+ def line_pattern(self):
343
+ """`LinePattern`: Pattern style of the grid lines to be drawn.
344
+
345
+ Possible values: `Solid <LinePattern.Solid>`, `Dashed`, `DashDot`,
346
+ `Dotted`, `LongDash`, `DashDotDot`.
347
+
348
+ Example usage::
349
+
350
+ >>> from tecplot.constant import LinePattern
351
+ >>> grid_lines.line_pattern = LinePattern.LongDash
352
+ """
353
+ return self._get_style(LinePattern, sv.LINEPATTERN)
354
+
355
+ @line_pattern.setter
356
+ def line_pattern(self, value):
357
+ self._set_style(LinePattern(value), sv.LINEPATTERN)
358
+
359
+ @property
360
+ def pattern_length(self):
361
+ """`float`: Segment length of the repeated line pattern.
362
+
363
+ Example usage::
364
+
365
+ >>> from tecplot.constant import LinePattern
366
+ >>> grid_lines.line_pattern = LinePattern.LongDash
367
+ >>> grid_lines.pattern_length = 3.5
368
+ """
369
+ return self._get_style(float, sv.PATTERNLENGTH)
370
+
371
+ @pattern_length.setter
372
+ def pattern_length(self, value):
373
+ self._set_style(float(value), sv.PATTERNLENGTH)
374
+
375
+
376
+ class GridLines(GridLinesStyle):
377
+ """Major grid lines.
378
+
379
+ .. code-block:: python
380
+ :emphasize-lines: 15-18
381
+
382
+ from os import path
383
+ import tecplot as tp
384
+ from tecplot.constant import LinePattern, Color
385
+
386
+ examples_dir = tp.session.tecplot_examples_directory()
387
+ datafile = path.join(examples_dir, 'SimpleData', 'Sphere.lpk')
388
+ dataset = tp.load_layout(datafile)
389
+
390
+ plot = tp.active_frame().plot()
391
+
392
+ plot.axes.grid_area.fill_color = Color.Grey
393
+
394
+ for axis in (plot.axes.x_axis, plot.axes.y_axis):
395
+ axis.show = True
396
+ grid_lines = axis.grid_lines
397
+ grid_lines.show = True
398
+ grid_lines.line_pattern = LinePattern.LongDash
399
+ grid_lines.color = Color.Cyan
400
+
401
+ plot.view.fit()
402
+
403
+ tp.export.save_png('grid_lines.png', 600, supersample=3)
404
+
405
+ .. figure:: /_static/images/grid_lines.png
406
+ :width: 300px
407
+ :figwidth: 300px
408
+ """
409
+ def __init__(self, axis):
410
+ GridLinesStyle.__init__(self, axis, sv.GRIDLINES)
411
+
412
+
413
+ class GridLines2D(GridLines):
414
+ """Major grid lines following the primary tick mark locations.
415
+
416
+ The lines drawn are determined by the placement of major tick marks along
417
+ the axis:
418
+
419
+ .. code-block:: python
420
+ :emphasize-lines: 10-13
421
+
422
+ from os import path
423
+ import tecplot as tp
424
+ from tecplot.constant import LinePattern, Color
425
+
426
+ examples_dir = tp.session.tecplot_examples_directory()
427
+ datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
428
+ dataset = tp.load_layout(datafile)
429
+
430
+ for axis in tp.active_frame().plot().axes:
431
+ grid_lines = axis.grid_lines
432
+ grid_lines.show = True
433
+ grid_lines.line_pattern = LinePattern.LongDash
434
+ grid_lines.color = Color.Green
435
+
436
+ tp.export.save_png('grid_lines_2d.png', 600, supersample=3)
437
+
438
+ .. figure:: /_static/images/grid_lines_2d.png
439
+ :width: 300px
440
+ :figwidth: 300px
441
+ """
442
+
443
+ @property
444
+ def draw_last(self):
445
+ """`bool`: Draw grid behind all other plot elements.
446
+
447
+ Example usage::
448
+
449
+ >>> axis.grid_lines.draw_last = True
450
+ """
451
+ return self._get_style(bool, sv.DRAWGRIDLAST)
452
+
453
+ @draw_last.setter
454
+ def draw_last(self, value):
455
+ self._set_style(bool(value), sv.DRAWGRIDLAST)
456
+
457
+
458
+ class MinorGridLines(GridLinesStyle):
459
+ """Minor grid lines.
460
+
461
+ .. code-block:: python
462
+ :emphasize-lines: 19-22
463
+
464
+ from os import path
465
+ import tecplot as tp
466
+ from tecplot.constant import LinePattern, Color
467
+
468
+ examples_dir = tp.session.tecplot_examples_directory()
469
+ datafile = path.join(examples_dir, 'SimpleData', 'Sphere.lpk')
470
+ dataset = tp.load_layout(datafile)
471
+
472
+ plot = tp.active_frame().plot()
473
+
474
+ plot.axes.grid_area.fill_color = Color.Grey
475
+
476
+ for axis in (plot.axes.x_axis, plot.axes.y_axis):
477
+ axis.show = True
478
+
479
+ grid_lines = axis.grid_lines
480
+ grid_lines.show = True
481
+
482
+ minor_grid_lines = axis.minor_grid_lines
483
+ minor_grid_lines.show = True
484
+ minor_grid_lines.line_pattern = LinePattern.Dotted
485
+ minor_grid_lines.color = Color.Cyan
486
+
487
+ plot.view.fit()
488
+
489
+ tp.export.save_png('minor_grid_lines.png', 600, supersample=3)
490
+
491
+ .. figure:: /_static/images/minor_grid_lines.png
492
+ :width: 300px
493
+ :figwidth: 300px
494
+ """
495
+ def __init__(self, axis):
496
+ GridLinesStyle.__init__(self, axis, sv.MINORGRIDLINES)
497
+
498
+
499
+ class MinorGridLines2D(MinorGridLines, GridLines2D):
500
+ """Minor grid lines following the secondary tick mark locations.
501
+
502
+ The lines drawn are determined by the placement of minor tick marks along
503
+ the axis. Example usage:
504
+
505
+ .. code-block:: python
506
+
507
+ from os import path
508
+ import tecplot as tp
509
+ from tecplot.constant import LinePattern, Color
510
+
511
+ examples_dir = tp.session.tecplot_examples_directory()
512
+ datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
513
+ dataset = tp.load_layout(datafile)
514
+
515
+ for axis in tp.active_frame().plot().axes:
516
+ grid_lines = axis.grid_lines
517
+ grid_lines.show = True
518
+
519
+ minor_grid_lines = axis.minor_grid_lines
520
+ minor_grid_lines.show = True
521
+ minor_grid_lines.line_pattern = LinePattern.Dotted
522
+ minor_grid_lines.color = Color.Green
523
+
524
+ tp.export.save_png('minor_grid_lines_2d.png', 600, supersample=3)
525
+
526
+ .. figure:: /_static/images/minor_grid_lines_2d.png
527
+ :width: 300px
528
+ :figwidth: 300px
529
+ """
530
+
531
+
532
+ class PolarAngleGridLines(GridLines2D):
533
+ """Major grid lines along the theta axis.
534
+
535
+ The lines drawn are determined by the placement of minor tick marks along
536
+ the axis. Example usage:
537
+
538
+ .. code-block:: python
539
+ :emphasize-lines: 17-20
540
+
541
+ from os import path
542
+ import tecplot as tp
543
+ from tecplot.constant import PlotType, ThetaMode, LinePattern, Color
544
+
545
+ examples_dir = tp.session.tecplot_examples_directory()
546
+ datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
547
+ dataset = tp.load_layout(datafile)
548
+
549
+ plot = tp.active_frame().plot(PlotType.PolarLine)
550
+ plot.activate()
551
+
552
+ plot.axes.theta_axis.mode = ThetaMode.Radians
553
+ plot.axes.grid_area.filled = True
554
+ plot.axes.grid_area.fill_color = Color.Creme
555
+
556
+ for axis in plot.axes:
557
+ grid_lines = axis.grid_lines
558
+ grid_lines.show = True
559
+ grid_lines.line_pattern = LinePattern.LongDash
560
+ grid_lines.color = Color.Green
561
+
562
+ for lmap in plot.linemaps():
563
+ lmap.show_in_legend = False
564
+ lmap.line.line_pattern = LinePattern.Solid
565
+ lmap.line.line_thickness = 0.8
566
+
567
+ tp.export.save_png('grid_lines_polar.png', 600, supersample=3)
568
+
569
+ .. figure:: /_static/images/grid_lines_polar.png
570
+ :width: 300px
571
+ :figwidth: 300px
572
+ """
573
+
574
+ @property
575
+ def radial_cutoff(self):
576
+ """`float` in percent along r-axis.: Minimum radial position of theta grid lines.
577
+
578
+ Example usage::
579
+
580
+ >>> plot.axes.theta_axis.grid_lines.radial_cutoff = 5
581
+ """
582
+ return self._get_style(float, sv.CUTOFF)
583
+
584
+ @radial_cutoff.setter
585
+ def radial_cutoff(self, value):
586
+ self._set_style(float(value), sv.CUTOFF)
587
+
588
+
589
+ class PolarAngleMinorGridLines(MinorGridLines2D, PolarAngleGridLines):
590
+ """Minor grid lines along the theta axis.
591
+
592
+ The lines drawn are determined by the placement of minor tick marks along
593
+ the axis. Example usage:
594
+
595
+ .. code-block:: python
596
+ :emphasize-lines: 20-23
597
+
598
+ from os import path
599
+ import tecplot as tp
600
+ from tecplot.constant import PlotType, ThetaMode, LinePattern, Color
601
+
602
+ examples_dir = tp.session.tecplot_examples_directory()
603
+ datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
604
+ dataset = tp.load_layout(datafile)
605
+
606
+ plot = tp.active_frame().plot(PlotType.PolarLine)
607
+ plot.activate()
608
+
609
+ plot.axes.theta_axis.mode = ThetaMode.Radians
610
+ plot.axes.grid_area.filled = True
611
+ plot.axes.grid_area.fill_color = Color.Creme
612
+
613
+ for axis in plot.axes:
614
+ grid_lines = axis.grid_lines
615
+ grid_lines.show = True
616
+
617
+ minor_grid_lines = axis.minor_grid_lines
618
+ minor_grid_lines.show = True
619
+ minor_grid_lines.line_pattern = LinePattern.Dotted
620
+ minor_grid_lines.color = Color.Green
621
+
622
+ for lmap in plot.linemaps():
623
+ lmap.show_in_legend = False
624
+ lmap.line.line_pattern = LinePattern.Solid
625
+ lmap.line.line_thickness = 0.8
626
+
627
+ tp.export.save_png('minor_grid_lines_polar.png', 600, supersample=3)
628
+
629
+ .. figure:: /_static/images/minor_grid_lines_polar.png
630
+ :width: 300px
631
+ :figwidth: 300px
632
+ """
633
+ def __init__(self, axis):
634
+ GridLinesStyle.__init__(self, axis, sv.MINORGRIDLINES)
635
+
636
+
637
+ class MarkerGridLine(GridLinesStyle):
638
+ """Marker line to indicate a particular position along an axis.
639
+
640
+ .. code-block:: python
641
+ :emphasize-lines: 17-27
642
+
643
+ from os import path
644
+ import tecplot as tp
645
+ from tecplot.constant import PlotType, Color, PositionMarkerBy
646
+
647
+ examples_dir = tp.session.tecplot_examples_directory()
648
+ datafile = path.join(examples_dir, 'SimpleData', 'Sphere.lpk')
649
+ dataset = tp.load_layout(datafile)
650
+
651
+ plot = tp.active_frame().plot(PlotType.Cartesian3D)
652
+ plot.activate()
653
+
654
+ plot.axes.grid_area.fill_color = Color.Grey
655
+
656
+ plot.axes.x_axis.show = True
657
+ plot.axes.y_axis.show = True
658
+
659
+ marker = plot.axes.x_axis.marker_grid_line
660
+ marker.show = True
661
+ marker.position_by = PositionMarkerBy.Constant
662
+ marker.position = 1.5
663
+ marker.color = Color.Cyan
664
+
665
+ marker = plot.axes.y_axis.marker_grid_line
666
+ marker.show = True
667
+ marker.position_by = PositionMarkerBy.Constant
668
+ marker.position = 0.5
669
+ marker.color = Color.Yellow
670
+
671
+ plot.view.fit()
672
+
673
+ tp.export.save_png('marker_grid_line.png', 600, supersample=3)
674
+
675
+ .. figure:: /_static/images/marker_grid_line.png
676
+ :width: 300px
677
+ :figwidth: 300px
678
+ """
679
+ def __init__(self, axis):
680
+ GridLinesStyle.__init__(self, axis, sv.MARKERGRIDLINE)
681
+
682
+ @property
683
+ def position_by(self):
684
+ """`PositionMarkerBy`: Position of the marker line in axes coordinates.
685
+
686
+ Possible values: `PositionMarkerBy.Constant` or
687
+ `PositionMarkerBy.SolutionTime`.
688
+
689
+ The position can be set to a constant or to the solution time of the
690
+ linked frame::
691
+
692
+ >>> from tecplot.constant import PositionMarkerBy
693
+ >>> marker_line = plot.axes.x_axis.marker_grid_line
694
+ >>> marker_line.position_by = PositionMarkerBy.SolutionTime
695
+ """
696
+ return self._get_style(PositionMarkerBy, sv.POSITIONMARKERBY)
697
+
698
+ @position_by.setter
699
+ def position_by(self, value):
700
+ self._set_style(PositionMarkerBy(value), sv.POSITIONMARKERBY)
701
+
702
+ @property
703
+ def position(self):
704
+ """`float`: Position of the marker line in axes coordinates.
705
+
706
+ The ``position_by`` attribute must be set to
707
+ `PositionMarkerBy.Constant`::
708
+
709
+ >>> from tecplot.constant import PositionMarkerBy
710
+ >>> marker_line = plot.axes.x_axis.marker_grid_line
711
+ >>> marker_line.position_by = PositionMarkerBy.Constant
712
+ >>> marker_line.position = 3.14
713
+ """
714
+ return self._get_style(float, sv.CONSTANTVALUE)
715
+
716
+ @position.setter
717
+ def position(self, value):
718
+ self._set_style(float(value), sv.CONSTANTVALUE)
719
+
720
+
721
+ class MarkerGridLine2D(MarkerGridLine, GridLines2D):
722
+ """Marker line to indicate a particular position along an axis.
723
+
724
+ .. code-block:: python
725
+ :emphasize-lines: 12-22
726
+
727
+ from os import path
728
+ import tecplot as tp
729
+ from tecplot.constant import PlotType, Color, PositionMarkerBy
730
+
731
+ examples_dir = tp.session.tecplot_examples_directory()
732
+ datafile = path.join(examples_dir, 'SimpleData', 'IndependentDependent.lpk')
733
+ dataset = tp.load_layout(datafile)
734
+
735
+ plot = tp.active_frame().plot(PlotType.XYLine)
736
+ plot.activate()
737
+
738
+ marker = plot.axes.x_axis(0).marker_grid_line
739
+ marker.show = True
740
+ marker.position_by = PositionMarkerBy.Constant
741
+ marker.position = -0.4
742
+ marker.color = Color.Blue
743
+
744
+ marker = plot.axes.y_axis(0).marker_grid_line
745
+ marker.show = True
746
+ marker.position_by = PositionMarkerBy.Constant
747
+ marker.position = -0.88
748
+ marker.color = Color.Blue
749
+
750
+ tp.export.save_png('marker_grid_line_2d.png', 600, supersample=3)
751
+
752
+ .. figure:: /_static/images/marker_grid_line_2d.png
753
+ :width: 300px
754
+ :figwidth: 300px
755
+ """
756
+
757
+ class PolarAngleMarkerGridLine(MarkerGridLine2D, PolarAngleGridLines):
758
+ """The marker grid line for the theta axis."""