[Python] How to superimpose the rotated subplot on the another sublot?

Discussão em 'Python' iniciado por Stack, Janeiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to release such configuration of plots as it presented on the picture: [​IMG]

    The next parameters have to be variable:

    1. Position of subplot origin point
    2. Rotation angle of subplot
    3. Size of subplot

    I tried to find solution using mpl_toolkits.axes_grid1.inset_locator.inset_axes (see below), but I can't change values of parameters 1,2 from the list above. Please, help me to find solution.

    import matplotlib.pyplot as plt
    import numpy as np
    from mpl_toolkits.axes_grid1.inset_locator import inset_axes

    x = np.linspace(0,100,100)
    y = np.linspace(0,100,100)

    fig, ax = plt.subplots(1, 1, figsize=[8, 8])
    axins = inset_axes(ax, width='40%', height='40%', loc='center')
    axins.set_xlim(0,80)
    axins.set_ylim(0,80)
    axins.plot(x,y)

    plt.show()


    [​IMG]

    Continue reading...

Compartilhe esta Página