2

My plot is not showing any indication of what the order of magnitude of my y-values are on the axis. How do I force python to indicate some values on the y-axis?

import numpy as np
import matplotlib.pyplot as plt

BERfinal = [0.4967843137254903, 0.49215686274509757, 0.4938823529411763, 
0.49170588235294116, 0.48852941176470605, 0.48203921568627417, 
0.4797058823529405, 0.47454901960784257, 0.4795686274509802, 
0.474901960784313, 0.4732549019607838, 0.4703137254901953, 
0.4705490196078425]

x = np.linspace(-4,8,len(BERfinal))
plt.semilogy(x,BERfinal)
plt.title("BER vs SNR")
plt.ylabel("Bit Error Rate(BER)")
plt.xlabel("Signal-to-Noise Ratio(SNR)[dB]")
plt.xlim(-4,8) 

enter image description here

1 Answer 1

1

I ended up playing around with:

plt.ylim(4.7*10**-1, 5*10**-1)  

and changed the values until I found an appropriate range. It now shows 5x10^-1 on the y-axis.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.