-1

Can anyone explain why the graph from the pandas plot doesn't display any of the numbers from the dataframe?

b = df_trend.ask[:10]
print b
0     100.86
2     100.85
3     100.84
4     100.84
5     100.85
7     100.85
9     100.85
11    100.84
12    100.85
14    100.85
Name: ask, dtype: float64

Output of the graph from using the plot method looks like this

b.plot()

enter image description here

Zocr
  • 93
  • 1
  • 6

2 Answers2

0

For some odd reason pandas consider 100.xx as large number? Setting the offset to False solved the problem.

Wrong value in matplotlib yticks

Community
  • 1
  • 1
Zocr
  • 93
  • 1
  • 6
0

pandas shows everything correctly - you can see it if you specify ylim parameter:

df.plot(ylim=(100.8, 100.9))

if you want to disable scientific notation use:

ax = df.plot(ylim=(100.8, 100.9))
ax.get_yaxis().get_major_formatter().set_useOffset(False)

plt.show()

enter image description here

MaxU - stand with Ukraine
  • 205,989
  • 36
  • 386
  • 419