示例#1
0
 def t1():
     scatter(grid=True,
             grid_lines='-.',
             cmap='magma',
             x_tick_number=5,
             color_bar=True,
             show=True)
示例#2
0
def scattr():
    scatter(grid=True,
            grid_lines='-.',
            cmap='magma',
            x_tick_number=5,
            plot_label="Graph",
            legend=True,
            color_bar=True,
            show=True)
示例#3
0
 def t2():
     x = np.linspace(0, 10, 1000)
     y = np.sinh(x)
     scatter(x=x,
             y=y,
             color="green",
             plot_label="Green bubbles",
             legend=True,
             legend_loc=(0.5, 0.5),
             resize_axes=True,
             show=True)
示例#4
0
    def f_path(self):
        fig = figure((12, 4))
        scatter(x=self.x,
                y=self.y,
                plot_label="Reference points",
                marker="x",
                point_size=30,
                color="#7aa9ff",
                zorder=0,
                resize_axes=False)
        plot_signal(
            x=self.rx,
            y=self.path,
            color="darkorange",
            plot_label="Path",
            # Axes
            x_label="x [m]",
            y_label="y [m]",
            # Ticks
            tick_number=10,
            # Bounds
            x_bounds=[0, 54],
            y_bounds=[-2, 16])
        import matplotlib.pyplot as plt
        # Contour plots
        x_0 = np.arange(0, 9, self.dx)
        y_0 = np.zeros(len(x_0))
        x_c60 = np.arange(9, self.X_60, self.dx)
        y_c60 = np.linspace(0, self.Y_60, len(x_c60))
        x_60 = np.arange(self.X_60, self.X_60 + 12, self.dx)
        y_60 = self.Y_60 * np.ones(len(x_60))
        x_90 = np.arange(self.X_60 + 12, self.x_90[-1], self.dx)
        y_90 = np.zeros(len(x_90))

        x_ref = np.concatenate((x_0, x_c60, x_60, x_90))
        y_ref = np.concatenate((y_0, y_c60, y_60, y_90))

        plt.plot(x_ref,
                 y_ref,
                 label="Reference",
                 linewidth=1,
                 linestyle="--",
                 zorder=0)

        # Other
        plt.gca().set_facecolor('#ffeed9')
        fig.patch.set_facecolor('#ffeed9')
        plt.legend(prop={'family': 'monospace'})
        plt.tight_layout()
        plt.show()
示例#5
0
    def test_three_d(self):
        from mpl_plotter.three_d import line, scatter, surface

        line(show=True)

        scatter(show=True)

        surface(show=True)

        # Wireframe
        surface(show=True,
                alpha=0,
                line_width=0.5,
                edge_color="red",
                cstride=12,
                rstride=12)
示例#6
0
    def test_two_d(self):
        from mpl_plotter.two_d import line, scatter, heatmap, quiver, streamline, fill_area

        line(show=show, backend=backend)

        scatter(show=show, backend=backend)

        heatmap(show=show, backend=backend)

        quiver(show=show, backend=backend)

        streamline(show=show, backend=backend)

        fill_area(show=show, backend=backend)

        # Input
        x = np.linspace(0, 2 * np.pi, 100)
        y = np.sin(x)
        line(x=x, y=y, show=show, backend=backend, aspect=1)
示例#7
0
    def test_two_d(self):
        from mpl_plotter.two_d import line, scatter, heatmap, quiver, streamline, fill_area

        line(show=True)

        scatter(show=True)

        heatmap(show=True)

        quiver(show=True)

        streamline(show=True)

        fill_area(show=True)

        # Input
        x = np.linspace(0, 2 * np.pi, 100)
        y = np.sin(x)
        line(x=x, y=y, show=True)