質問

Using the code below it produce a plot where y-axis is 0.0 to 2.5 1e7. How is it possible to avoid values with 1e7?

    import pandas as pd
    import matplotlib.pyplot as plt
    a = {'Test1': {1: 21867186, 4: 20145576, 10: 18018537},
         'Test2': {1: 23256313, 4: 21668216, 10: 19795367}}

    d = pd.DataFrame(a).T
    #print d

    f = plt.figure()

    plt.title('Title here!', color='black')
    d.plot(kind='bar', ax=f.gca())
    plt.show()
役に立ちましたか?

解決

Use ticklabel_format(style = 'plain') as in the following example.

import pandas as pd
import matplotlib.pyplot as plt
a = {'Test1': {1: 21867186, 4: 20145576, 10: 18018537},
     'Test2': {1: 23256313, 4: 21668216, 10: 19795367}}

d = pd.DataFrame(a).T
#print d

f = plt.figure()

plt.ticklabel_format(style = 'plain')

plt.title('Title here!', color='black')
d.plot(kind='bar', ax=f.gca())
plt.show()

I hope this is what you meant.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top