Skip to content

Bug showing blank graphs with SDR #21243

@alexxmarsh44

Description

@alexxmarsh44

plt.psd(samples) shows a blank graph. This is a fresh linux debian install with code that normally works with matplotlib.

Matplotlib Version
3.4.3
Platform Python Version
3.7.3

Code Snippit:

import uhd
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import sys
print(matplotlib.__version__)
import platform
print(platform.python_version())
import matplotlib.animation as animation
#matplotlib.use('TkAgg')
np.set_printoptions(threshold=sys.maxsize)

usrp = uhd.usrp.MultiUSRP()
samples = usrp.recv_num_samps(10000, 100e6, 1e6, [0], 100)
print(samples[0:10])

fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1)

def animate(i):
    #ax1.clear()
    #samples = usrp.recv_num_samps(10000, 100e6, 1e6, [0], 100)
    #fft1 = np.fft.fft(samples)
    #plt.ylim(-10, 10)
    #plt.plot(samples, marker="o")
    #plt.show()
    ax1.psd(samples[0:10])

    #plt.show(block=False)
    #plt.pause(00.01)


ani = animation.FuncAnimation(fig, animate, interval=1)
plt.show()

expected outcome:

A power spectrum density graph from the software defined radio.

Actual outcome:

Screenshot_2021-09-30_21-53-04

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions