Exemplo n.º 1
0
    def test__plot_grid__works_with_all_extras_included(
            self, plot_path, plot_patch):
        grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)
        color_array = np.linspace(start=0.0, stop=1.0, num=grid.shape_1d)

        plotter = aplt.Plotter(
            output=aplt.Output(path=plot_path, filename="grid1", format="png"))

        plotter.plot_grid(
            grid=grid,
            color_array=color_array,
            axis_limits=[-1.5, 1.5, -2.5, 2.5],
            lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]],
            indexes=[0, 1, 2, 14],
            symmetric_around_centre=False,
        )

        assert plot_path + "grid1.png" in plot_patch.paths

        plotter = aplt.Plotter(
            output=aplt.Output(path=plot_path, filename="grid2", format="png"))

        plotter.plot_grid(
            grid=grid,
            color_array=color_array,
            axis_limits=[-1.5, 1.5, -2.5, 2.5],
            lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]],
            indexes=[0, 1, 2, 14],
            symmetric_around_centre=True,
        )

        assert plot_path + "grid2.png" in plot_patch.paths

        aplt.grid(
            grid=grid,
            color_array=color_array,
            axis_limits=[-1.5, 1.5, -2.5, 2.5],
            lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]],
            indexes=[0, 1, 2, 14],
            symmetric_around_centre=True,
            plotter=aplt.Plotter(output=aplt.Output(
                path=plot_path, filename="grid3", format="png")),
        )

        assert plot_path + "grid3.png" in plot_patch.paths
Exemplo n.º 2
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)

aplt.grid(grid=grid, axis_limits=[-1.5, 1.5, -2.5, 2.5])
Exemplo n.º 3
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)

aplt.grid(grid=grid, include_origin=True)
Exemplo n.º 4
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)

aplt.grid(grid=grid, include_border=True)
Exemplo n.º 5
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)

aplt.grid(grid=grid, indexes=[0, 1, 2, 14])

aplt.grid(grid=grid, indexes=[(0, 0), (2, 3), (4, 1), (8, 5)])

aplt.grid(grid=grid, indexes=[[(0, 0), (2, 3)], [(4, 1), (8, 5)]])

aplt.grid(grid=grid, indexes=[[[0, 0], [2, 3]], [[4, 1], [8, 5]]])
Exemplo n.º 6
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)

aplt.grid(grid=grid, lines=[(1.0, 1.0), (2.0, 2.0)])

aplt.grid(grid=grid,
          lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]])
Exemplo n.º 7
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)
color_array = np.linspace(start=0.0, stop=1.0, num=grid.shape_1d)

aplt.grid(grid=grid, color_array=color_array)
Exemplo n.º 8
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)

aplt.grid(grid=grid, symmetric_around_centre=True)

grid = aa.grid.uniform(shape_2d=(11, 11),
                       pixel_scales=1.0,
                       origin=(10.0, 10.0))

aplt.grid(grid=grid, symmetric_around_centre=False)
aplt.grid(grid=grid, symmetric_around_centre=True)
Exemplo n.º 9
0
import autoarray as aa
import autoarray.plot as aplt
import numpy as np

grid = aa.grid.uniform(shape_2d=(11, 11), pixel_scales=1.0)

color_array = np.linspace(start=0.0, stop=1.0, num=grid.shape_1d)

aplt.grid(
    grid=grid,
    color_array=color_array,
    axis_limits=[-1.5, 1.5, -2.5, 2.5],
    lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]],
    indexes=[0, 1, 2, 14],
    symmetric_around_centre=False,
)

aplt.grid(
    grid=grid,
    color_array=color_array,
    axis_limits=[-1.5, 1.5, -2.5, 2.5],
    lines=[[(1.0, 1.0), (2.0, 2.0)], [(2.0, 4.0), (5.0, 6.0)]],
    indexes=[0, 1, 2, 14],
    symmetric_around_centre=True,
)