예제 #1
0
def plot_blends(blends, indices, log):
    fig, axes = plt.subplots(nrows=4,
                             ncols=4,
                             sharex=True,
                             sharey=True,
                             figsize=(20, 20),
                             tight_layout=True)

    norm = asin_stretch_norm(blends[indices])

    for i, ax in enumerate(axes.flatten()):
        idx = indices[i]
        ax.imshow(blends[idx], norm=norm, cmap=img_cmap)
        # ax.set_title(f"ID={idx}, dist={small_cat.distance[idx]:.2f}, magdiff={small_cat.magdiff[idx]:.2f}")
        ax.set_axis_off()

    a = AnchoredDirectionArrows(axes[0, 0].transAxes,
                                r'$\Delta$ mag',
                                'distance [pix]',
                                loc='upper left',
                                aspect_ratio=-1,
                                sep_x=0.02,
                                sep_y=-0.04,
                                color='white')
    axes[0, 0].add_artist(a)

    fig.savefig(f"plots/figure2.png")
예제 #2
0
def test_anchored_direction_arrows_many_args():
    fig, ax = plt.subplots()
    ax.imshow(np.ones((10, 10)))

    direction_arrows = AnchoredDirectionArrows(
            ax.transAxes, 'A', 'B', loc='upper right', color='red',
            aspect_ratio=-0.5, pad=0.6, borderpad=2, frameon=True, alpha=0.7,
            sep_x=-0.06, sep_y=-0.08, back_length=0.1, head_width=9,
            head_length=10, tail_width=5)
    ax.add_artist(direction_arrows)
예제 #3
0
def test_anchored_direction_arrows():
    fig, ax = plt.subplots()
    ax.imshow(np.zeros((10, 10)), interpolation='nearest')

    simple_arrow = AnchoredDirectionArrows(ax.transAxes, 'X', 'Y')
    ax.add_artist(simple_arrow)
def test_anchored_direction_arrows():
    fig, ax = plt.subplots()
    ax.imshow(np.zeros((10, 10)))

    simple_arrow = AnchoredDirectionArrows(ax.transAxes, "X", "Y")
    ax.add_artist(simple_arrow)
예제 #5
0
"""
=============================
Demo Anchored Direction Arrow
=============================

"""
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredDirectionArrows
import matplotlib.font_manager as fm

fig, ax = plt.subplots()
ax.imshow(np.random.random((10, 10)))

# Simple example
simple_arrow = AnchoredDirectionArrows(ax.transAxes, 'X', 'Y')
ax.add_artist(simple_arrow)

# High contrast arrow
high_contrast_part_1 = AnchoredDirectionArrows(
                            ax.transAxes,
                            '111', r'11$\overline{2}$',
                            loc=1,
                            arrow_props={'ec': 'w', 'fc': 'none', 'alpha': 1,
                                         'lw': 2}
                            )
ax.add_artist(high_contrast_part_1)

high_contrast_part_2 = AnchoredDirectionArrows(
                            ax.transAxes,
                            '111', r'11$\overline{2}$',