import numpy 
import tecplot
from tecplot.constant import *

tecplot.session.connect()

dataset = tecplot.active_frame().create_dataset('Data', ['x', 'y']) 

x = numpy.linspace(-4, 4, 100)

zone = dataset.add_ordered_zone('sin(x)', len(x))
zone.values('x')[:] = x
zone.values('y')[:] = numpy.sin(x)

zone = dataset.add_ordered_zone('cos(x)', len(x))
zone.values('x')[:] = x
zone.values('y')[:] = numpy.cos(x)

zone = dataset.add_ordered_zone('tan(x)', len(x))
zone.values('x')[:] = x
zone.values('y')[:] = numpy.tan(x)

plot = tecplot.active_frame().plot(PlotType.XYLine)
plot.activate()

for lmap in plot.linemaps():
    lmap.show = True
    lmap.line.line_thickness = 0.6

plot.legend.show = True
tecplot.data.save_tecplot_plt("create_data_zone.plt")
tecplot.save_layout("create_data_zone.lay")
