Esempio n. 1
0
 def test_streamline(self):
     x = np.linspace(0, 10, 1000)
     y = np.linspace(0, 10, 1000)
     x, y = np.meshgrid(x, y)
     u = np.cos(x)
     v = np.cos(y)
     streamline(x=x, y=y, u=u, v=v, color=u, color_bar=True, show=True)
Esempio n. 2
0
    def test_demo(self):

        fig = figure((18, 8), backend=backend)

        ax1 = plt.subplot2grid((2, 6), (0, 0),
                               colspan=2,
                               rowspan=2,
                               projection='3d',
                               facecolor="#fff6e6")
        ax2 = plt.subplot2grid((2, 6), (0, 3), rowspan=1, aspect=1)
        ax3 = plt.subplot2grid((2, 6), (1, 3), rowspan=1, aspect=1)
        ax4 = plt.subplot2grid((2, 6), (0, 5), rowspan=1, aspect=1)
        ax5 = plt.subplot2grid((2, 6), (1, 5), rowspan=1, aspect=1)

        surface(fig=fig,
                ax=ax1,
                title="Demo",
                title_size=70,
                title_weight="bold",
                title_font="Pump Triline",
                title_color="#e69300",
                plot_label="Surface",
                background_color_plot="#fff6e6",
                edge_color="lightgrey",
                edges_to_rgba=True,
                azim=-160,
                elev=43)
        fill_area(fig=fig, ax=ax2, plot_label="Fill", aspect=1, grid=False)
        quiver(fig=fig, ax=ax3, plot_label="Quiver", grid=False)
        heatmap(fig=fig,
                ax=ax4,
                title="No label",
                plot_label="Heatmap",
                grid=False)
        streamline(fig=fig,
                   ax=ax5,
                   line_density=1,
                   title="No label",
                   plot_label="Streamline",
                   grid=False)

        custom_canvas2(fig=fig,
                       ax=ax2,
                       background_color_figure="#fff6e6",
                       legend=True,
                       legend_loc=(0.6725, 0.425),
                       resize_axes=False)

        if show:
            plt.show()
Esempio n. 3
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)
Esempio n. 4
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)