def test_3d():

    generate_preset_3d(preset_dest="presets",
                       preset_name="MYPRESET3D",
                       disable_warning=True,
                       overwrite=False)

    # Proceed to customize your 2D plots using the preset

    my_plot = three_d(preset_dir="presets", preset_name="MYPRESET3D").line

    my_plot(show=True,
            demo_pad_plot=True,
            color="blue",
            title="TITLE",
            aspect=1)
Exemple #2
0
from mpl_plotter.presets.custom import two_d, three_d
from mpl_plotter.presets.standard.precision import preset2, preset3

two_d(direct_preset=preset2)
three_d(direct_preset=preset3)
Exemple #3
0
    def test_3d(self):
        """
        Preferred use:

            generate_preset_3d(preset_dest="presets", preset_name="MYPRESET3D", disable_warning=True, overwrite=False)

            my_plot = three_d(preset_dir="presets", preset_name="MYPRESET3D").line

        Use to enable testing:
        """
        from tests.presets.MYPRESET3D import preset
        my_fam = three_d(direct_preset=preset)

        my_fam.line(show=show,
                    backend=backend,
                    demo_pad_plot=True,
                    color="blue",
                    title="TITLE")
        my_fam.scatter(show=show,
                       backend=backend,
                       demo_pad_plot=True,
                       color="blue",
                       title="TITLE")
        my_fam.surface(show=show, backend=backend, title="TITLE")

        x = np.linspace(0, 1, 100)
        y = np.linspace(0, 1, 100)
        x, y = np.meshgrid(x, y)
        z = np.sin(x**2 + y**2)
        my_fam.surface(x,
                       y,
                       z,
                       show=show,
                       backend=backend,
                       demo_pad_plot=True,
                       title="TITLE",
                       azim=-58,
                       elev=28,
                       lighting=True,
                       shade=True,
                       line_width=0)
        my_fam.surface(x,
                       y,
                       z,
                       show=show,
                       backend=backend,
                       demo_pad_plot=True,
                       title="TITLE",
                       azim=-58,
                       elev=28,
                       color="orange",
                       line_width=0)
        my_fam.surface(x,
                       y,
                       z,
                       show=show,
                       backend=backend,
                       demo_pad_plot=True,
                       title="TITLE",
                       azim=-58,
                       elev=28,
                       color="orange",
                       lighting=True,
                       shade=True,
                       line_width=0)
        my_fam.surface(x,
                       y,
                       z,
                       show=show,
                       backend=backend,
                       demo_pad_plot=True,
                       title="TITLE",
                       azim=-58,
                       elev=28,
                       color="black",
                       lighting=True,
                       shade=True,
                       line_width=0)