Ejemplo n.º 1
0
    def plot_data(self):
        hatching = plot_data.HatchingSet(0.5, 3)
        edge_style = plot_data.EdgeStyle(line_width=1,
                                         color_stroke=BLUE,
                                         dashline=[])
        surface_style = plot_data.SurfaceStyle(color_fill=WHITE,
                                               opacity=1,
                                               hatching=hatching)

        pt1 = vm.Point2D(0, 0)
        pt2 = vm.Point2D(0, self.ly)
        pt3 = vm.Point2D(self.lx, self.ly)
        pt4 = vm.Point2D(self.lx, 0)
        c1 = vm.wires.Contour2D([
            vm.edges.LineSegment2D(pt1, pt2),
            vm.edges.LineSegment2D(pt2, pt3),
            vm.edges.LineSegment2D(pt3, pt4),
            vm.edges.LineSegment2D(pt4, pt1)
        ])
        contours = [c1]
        for i in range(5):
            vector = vm.Vector2D(random.uniform(0, 2), random.uniform(0, 2))
            c2 = c1.translation(vector, copy=True)
            contours.append(c2)

        plot_datas = [
            c.plot_data(edge_style=edge_style, surface_style=surface_style)
            for c in contours
        ]
        return plot_data.PrimitiveGroup(primitives=plot_datas)
Ejemplo n.º 2
0
 def plot_data(self):
     hatching = plot_data.HatchingSet(0.1)
     edge_style = plot_data.EdgeStyle(line_width=1)
     surface_style = plot_data.SurfaceStyle(hatching=hatching)
     contour = self.contour()
     plot_datas = contour.plot_data(edge_style=edge_style, surface_style=surface_style)
     return [plot_data.PrimitiveGroup(primitives=[plot_datas])]
Ejemplo n.º 3
0
 def plot_data(self):
     edge_style = plot_data.EdgeStyle()
     rgbs = [[192, 11, 11], [14, 192, 11], [11, 11, 192]]
     return plot_data.ParallelPlot(elements=self.points,
                                   edge_style=edge_style,
                                   disposition='vertical',
                                   axes=['x', 'y', 'z', 'm'],
                                   rgbs=rgbs)
Ejemplo n.º 4
0
    def plot_data(self, full_contour=True):
        hatching = plot_data.HatchingSet(0.1)
        edge_style = plot_data.EdgeStyle(line_width=1)
        surface_style = plot_data.SurfaceStyle(hatching=hatching)

        contour = self.contour(full_contour=full_contour)
        contour_data = contour.plot_data(edge_style=edge_style,
                                         surface_style=surface_style)
        return [plot_data.PrimitiveGroup(primitives=[contour_data])]
Ejemplo n.º 5
0
    def plot_data(self):
        plot_datas = []
        hatching = plot_data.HatchingSet(0.1)
        edge_style = plot_data.EdgeStyle(line_width=1)
        surface_style = plot_data.SurfaceStyle(hatching=hatching)

        for panel, grid in zip(self.panels, self.grids):
            c = panel.contour()
            contour = c.translation(grid, copy=True)
            plot_datas.append(contour.plot_data(edge_style=edge_style, surface_style=surface_style))
        contour_inter = self.intersection_area()
        plot_datas.append(contour_inter.plot_data(edge_style=edge_style, surface_style=plot_data.SurfaceStyle()))
        return plot_datas
Ejemplo n.º 6
0
 def data_set1(self):
     attributes = ['x', 'y']
     tooltip = plot_data.Tooltip(attributes=attributes)
     point_style = plot_data.PointStyle(color_fill=RED, color_stroke=BLACK)
     edge_style = plot_data.EdgeStyle(color_stroke=BLUE, dashline=[10, 5])
     elements = []
     for x, y in zip(self.x, self.y1):
         elements.append({'x': x, 'y': y})
     return plot_data.Dataset(elements=elements,
                              name='y = sin(x)',
                              tooltip=tooltip,
                              point_style=point_style,
                              edge_style=edge_style)
Ejemplo n.º 7
0
    def plot_data(self):
        color_fill = LIGHTBLUE
        color_stroke = GREY
        point_style = plot_data.PointStyle(color_fill=color_fill,
                                           color_stroke=color_stroke)
        axis = plot_data.Axis()
        attributes = ['x', 'y']
        tooltip = plot_data.Tooltip(attributes=attributes)
        objects = [
            plot_data.Scatter(tooltip=tooltip,
                              x_variable=attributes[0],
                              y_variable=attributes[1],
                              point_style=point_style,
                              elements=self.points,
                              axis=axis)
        ]

        edge_style = plot_data.EdgeStyle()
        rgbs = [[192, 11, 11], [14, 192, 11], [11, 11, 192]]
        objects.append(
            plot_data.ParallelPlot(elements=self.points,
                                   edge_style=edge_style,
                                   disposition='vertical',
                                   axes=['x', 'y', 'z', 'm'],
                                   rgbs=rgbs))

        coords = [(0, 0), (500, 0)]
        sizes = [
            plot_data.Window(width=500, height=500),
            plot_data.Window(width=500, height=500)
        ]

        return plot_data.MultiplePlots(elements=self.points,
                                       plots=objects,
                                       sizes=sizes,
                                       coords=coords)
Ejemplo n.º 8
0
 def plot_data(self):
     edge_style = plot_data.EdgeStyle(line_width=1, color_stroke=RED)
     plot_datas = self.panel_combination.plot_data()
     circles = self.contour()
     plot_datas.extend([c.plot_data(edge_style=edge_style) for c in circles])
     return [plot_data.PrimitiveGroup(primitives=plot_datas)]