-1

I am learning to use matplotlib with the book "Python Crash Course". After completely following the book's instructions to draw a graph, my graph and the book's graph look different in that the book's graph shows the y ticks fully but mine are shortened.

I'll attach the images of both graphs, Would appreciate it if someone could guide me on how to get my graph to look like the book's.

My graph:

enter image description here

the book's graph:

enter image description here

arian_lrd
  • 13
  • 2
  • Does this answer your question? [prevent scientific notation in matplotlib.pyplot](https://stackoverflow.com/questions/28371674/prevent-scientific-notation-in-matplotlib-pyplot) – BigBen Dec 09 '21 at 16:59

1 Answers1

1

You can specify the tick label format as scientific or plain as cited here

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(0, 1000, 1)
y = np.power(x, 2)

plt.plot(x, y)
plt.ticklabel_format(style="plain") 
plt.show()

enter image description here