#print "errScale:", figure.errScale #print "confScale:", figure.stdev.get_conf_scale_1d() # line line, = figure.gca().plot([x, x], [y - stdev, y + stdev]) line.set_solid_capstyle("butt") figure.set_style(style, line) if __name__ == "__main__": from gizela.pyplot.FigureLayoutBase import FigureLayoutBase fig = FigureLayoutBase() from gizela.data.PointCartCovMat import PointCartCovMat p = PointCartCovMat(id="A", x=0, y=0) p.var = (9, 4) print p.errEll style = {} PlotPoint.plot_point_xy(fig, p.x, p.y, style) PlotPoint.plot_label_xy(fig, p.id, p.x, p.y, style) PlotPoint.plot_error_ellipse_xy(fig, p.x, p.y, p.errEll, style) PlotPoint.plot_vector_xy(fig, [p.x, p.x + 3, p.x + 1.0], [p.y, p.y - 2, p.y - 1.5], style, style) fig.gca().axis([-4,4,-4,4])
# adding print "adding" pd2=PointList() pd2.add_point(PointCart(id="AB",x=0,y=5,z=30)) pd2.add_point(PointCart(id="BB",x=10,y=10,z=30)) pd2.extend(pd) print pd print pd2 # graph try: from gizela.pyplot.FigureLayoutBase import FigureLayoutBase except: print "import of graphics failed" else: fig = FigureLayoutBase() pd.plot_(fig) pd2.plot_(fig) fig.set_free_space() fig.show_() # test of coordinates update from gizela.data.PointLocalGama import PointLocalGama from gizela.data.GamaCoordStatus import GamaCoordStatus point1 = PointLocalGama(id="A", x=1, y=2, status=GamaCoordStatus.fix_xy) point2 = PointLocalGama(id="B", x=100, y=200, status=GamaCoordStatus.adj_xy) point3 = PointLocalGama(id="A", x=10, y=20, status=GamaCoordStatus.adj_xy) pl = PointList() pl.add_point(point1) p = pl.get_point(id="A") p.x=10
pd.add_point(c1) pd.add_point(c2) pd.add_point(c3) pd.add_point(c4) pd.covmat = covmat # adjusting variances pd.get_point("A").var = (0.01**2, 0.02**2, 0.02**2) c2.var = (0.02**2, 0.01**2, 0.01**2) c3.var = (0.03**2, 0.03**2) c4.varz = 0.04**2 #print pd print c1.covmat print pd print pd.make_gama_xml() # graph try: from gizela.pyplot.FigureLayoutBase import FigureLayoutBase except: print "import of graphic failed" else: fig = FigureLayoutBase() fig.set_axes_ori("ne") fig.errScale = 2 pd.plot_(fig) pd.plot_error_ellipse(fig) fig.set_free_space() fig.show_()
c2.textTable.type = "plain" print c1 print print c2 print c2.make_gama_xml() print c1 * 2 print c1 * 2.0 print (c1 * 2) + c1 print c1 - c1 print "# comparison" print c1 == c2 print c1 != c2 print c1 == "A" print c1 != "A" print "A" == c1 # graph from gizela.pyplot.FigureLayoutBase import FigureLayoutBase fig = FigureLayoutBase() c1.plot_(fig) c2.plot_(fig) c2.plot_x(fig, 5) c2.plot_y(fig, 5) c2.plot_z(fig, 5) fig.set_free_space() fig.set_aspect_equal() fig.show_()