[Python] Matplotlib zoomed in x-axis at beginning and end

Discussão em 'Python' iniciado por Stack, Fevereiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    I have a signal with a relatively high frequency and I want to have a detailed look at the start of the recorded signal and the end. Like the signal is 1 hour long and I want the first 10 seconds and the last 10 seconds kind of zoomed in (on the x-axis) and the middle section "normal".

    I already found this method

    axs.set_yscale('function', functions=(forward, inverse))


    which should be able to define a custom scale, but I'm unable to understand how this works and I can not find a lot of documentation on this method.

    I can not share the real data, but the data looks very similar to a sinus, so one can use this plot to visualize it:

    fig, axs = plt.subplots()
    x = np.arange(0, 1000 * np.pi, 0.1)
    y = 2 * np.sin(x) + 3
    axs.plot(x, y)

    Continue reading...

Compartilhe esta Página