Python Forum
Getting proper x,y axis values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting proper x,y axis values
#1
I am trying to change the values of the axes so that the x and y values (0.3,0.4) and (0.3,1) are shown on the axes for the points. Anyone know how to properly do this?
    from scipy.fft import fft2, fftshift
    import numpy as np
    import matplotlib.pyplot as plt
    from skimage.filters import window
    from scipy.fftpack import fftfreq


    k = np.linspace(0,4.76*10,2400)
    kx,ky = np.meshgrid(k, k)
    x1 = 0.3
    y1 = 0.4
    x2 = 0.3
    y2 = 1

    z = 0.05*np.cos(2*np.pi*kx*x1 + 2*np.pi*ky*y1) + 0.05*np.cos(2*np.pi*kx*x2 + 2*np.pi*ky*y2)

    wz = z * window('hann', z.shape)

    plt.figure(0)
    plt.imshow(wz)

    f = fftfreq(len(k), np.diff(k)[0])
    zf = np.abs(fftshift(fft2(wz)))[1200:, 1200:]
    plt.figure(1)
    plt.axis([0,100, 0,100])

    plt.imshow(zf)
    plt.show()
Reply


Messages In This Thread
Getting proper x,y axis values - by pyhill00 - Jul-29-2022, 03:30 PM
RE: Getting proper x,y axis values - by deanhystad - Jul-29-2022, 04:05 PM
RE: Getting proper x,y axis values - by pyhill00 - Jul-29-2022, 04:43 PM
RE: Getting proper x,y axis values - by deanhystad - Jul-29-2022, 05:07 PM
RE: Getting proper x,y axis values - by pyhill00 - Jul-29-2022, 05:11 PM
RE: Getting proper x,y axis values - by deanhystad - Jul-29-2022, 05:49 PM
RE: Getting proper x,y axis values - by pyhill00 - Jul-29-2022, 05:57 PM
RE: Getting proper x,y axis values - by deanhystad - Jul-29-2022, 06:46 PM
RE: Getting proper x,y axis values - by pyhill00 - Jul-29-2022, 06:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pyserial issues with proper loops and binary jttolleson 16 2,624 Nov-02-2023, 08:39 PM
Last Post: deanhystad
  Print names in x-axis of a time-series values hobbyist 4 1,235 Apr-22-2023, 09:29 PM
Last Post: deanhystad
  ValueError: Length mismatch: Expected axis has 8 elements, new values have 1 elements ilknurg 1 5,155 May-17-2022, 11:38 AM
Last Post: Larz60+
  Proper way to do the OR statement? Mark17 5 1,776 Mar-01-2022, 01:54 PM
Last Post: Mark17
  Sample labels from excel file in order to put them on x-axis and y-axis of a plot hobbyist 11 4,387 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  Put zero for x axis values quest 4 2,290 Jul-29-2021, 01:34 PM
Last Post: DeaD_EyE
  Difference Between Figure Axis and Sub Plot Axis in MatplotLib JoeDainton123 2 2,476 Aug-21-2020, 10:17 PM
Last Post: JoeDainton123
  proper use of 'end' in a 'with' statement ccrider27 1 2,066 Mar-18-2020, 10:33 PM
Last Post: buran
  Proper use of if..elif..else statement nick1941 2 2,427 Mar-06-2020, 11:22 PM
Last Post: nick1941
  Proper Layout of Code Question TheJax 2 2,206 Feb-08-2020, 06:14 PM
Last Post: TheJax

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020