File indexing completed on 2024-12-22 04:17:10
0001 #!/usr/bin/python2.7 0002 import pykst as kst 0003 0004 client=kst.Client("viewitems") 0005 0006 0007 P1=client.new_plot((0.25,0.25),(0.5,0.5),0) 0008 P1.set_x_range(-10.0,10.0) 0009 P1.set_global_font("courier",12,False,False) 0010 0011 C1 = client.new_circle((0.9,0.3),0.1, stroke_width = 2, stroke_brush_color="red") 0012 C1.set_fill_color("Green") 0013 0014 C1.set_diameter(0.05) 0015 0016 B1 = client.new_box((0.9,0.9), (0.1,0.1), fill_color="pink") 0017 0018 E1 = client.new_ellipse((0.1, 0.7), (0.1, 0.1), 45, fill_color="blue") 0019 0020 A1 = client.new_arrow((0.1, 0.5), (0.2, 0.8), False, True, 18) 0021 A1.set_stroke_style(3) 0022 #A1.set_endpoints((0.2, 0.7), (0.05, 0.8)) 0023 0024 L1 = client.new_line((0.20, 0.20), (0.30, 0.30), stroke_width=2, stroke_brush_color="green") 0025 L1.set_stroke_style(2) 0026 L1.set_parent_auto() 0027 L1.set_lock_pos_to_data(True) 0028 L1.set_endpoints((-5,-0.05), (5, 0.05)) 0029 0030 Label = client.new_label("Label Here", (0.7,0.7), 0, 16, font_family="courier") 0031 Label.set_font_italic(True) 0032 0033 Label2 = client.new_label("Sub Label Here", (0.25,0.25), 0, 16, font_family="courier") 0034 Label2.set_font_bold(True) 0035 Label2.set_parent_auto() 0036 0037 P1.set_pos((0.5,0.5)) 0038 P1.set_fixed_aspect_ratio(True) 0039 0040 print Label2.position(), Label2.dimensions() 0041 0042 Label2.set_lock_pos_to_data(True) 0043 Label2.set_pos((5,0)) 0044 0045 B1.set_pos((0.4, 0.4)) 0046 0047 B1.set_parent_auto() 0048 0049 B1.set_lock_pos_to_data(True) 0050 B1.set_pos((-5, 0.05))