I can create a psd plot like this:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv('signal.csv')/1000
dt = df.iloc[1,0] - df.iloc[0,0]
data=df['1']
print(f'time delta: {dt*1e12:.0f} ps')
print(f'time: {(len(data)*dt*1e6):.3f} \u03BCs')
resolution = 2000
plt.psd(data,
resolution,
1/0.1,
lw=1,
color='red');
plt.xlim(0,5)
plt.xlabel('Frequency / GHz')
plt.ylabel('Power Spectral Density / dB/Hz')
plt.show()
How can I change its ytickrate? When I try adding:
plt.yticks(np.arange(-100,0,10))
the whole graph is morphed:
How can I change the psd plot so that the y axis is represented in 10's without changing the plot?


