0

When generating a scatter, I'm getting incorrect Y values being displayed. I'm assuming this is due to the number being quite large. Is there a way to display the actual number itself to make the graphs more readable?

The graph code is:

dataset = pd.read_csv('Regression.csv')
    fund_figs, axes = plt.subplots(1, 41)
    dataset.plot(kind='scatter', x='Avon and Somerset', y='Total Funding', ax=axes[0], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Bedfordshire', y='Total Funding', ax=axes[1], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Cambridgeshire', y='Total Funding', ax=axes[2], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Cheshire', y='Total Funding', ax=axes[3], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Cleveland', y='Total Funding', ax=axes[4], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Cumbria', y='Total Funding', ax=axes[5], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Derbyshire', y='Total Funding', ax=axes[6], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Devon and Cornwall', y='Total Funding', ax=axes[7], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Dorset', y='Total Funding', ax=axes[8], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Durham', y='Total Funding', ax=axes[9], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Dyfed-Powys', y='Total Funding', ax=axes[10], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Essex', y='Total Funding', ax=axes[11], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Gloucestershire', y='Total Funding', ax=axes[12], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Greater Manchester', y='Total Funding', ax=axes[13], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Gwent', y='Total Funding', ax=axes[14], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Hampshire', y='Total Funding', ax=axes[15], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Hertfordshire', y='Total Funding', ax=axes[16], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Humberside', y='Total Funding', ax=axes[17], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Kent', y='Total Funding', ax=axes[18], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Lancashire', y='Total Funding', ax=axes[19], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Leicestershire', y='Total Funding', ax=axes[20], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Lincolnshire', y='Total Funding', ax=axes[21], figsize=(150, 8))
    dataset.plot(kind='scatter', x='London, City of', y='Total Funding', ax=axes[22], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Merseyside', y='Total Funding', ax=axes[23], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Norfolk', y='Total Funding', ax=axes[24], figsize=(150, 8))
    dataset.plot(kind='scatter', x='North Wales', y='Total Funding', ax=axes[25], figsize=(150, 8))
    dataset.plot(kind='scatter', x='North Yorkshire', y='Total Funding', ax=axes[26], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Northamptonshire', y='Total Funding', ax=axes[27], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Nottinghamshire', y='Total Funding', ax=axes[28], figsize=(150, 8))
    dataset.plot(kind='scatter', x='South Wales', y='Total Funding', ax=axes[29], figsize=(150, 8))
    dataset.plot(kind='scatter', x='South Yorkshire', y='Total Funding', ax=axes[30], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Staffordshire', y='Total Funding', ax=axes[31], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Suffolk', y='Total Funding', ax=axes[32], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Surrey', y='Total Funding', ax=axes[33], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Sussex', y='Total Funding', ax=axes[34], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Thames Valley', y='Total Funding', ax=axes[35], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Warwickshire', y='Total Funding', ax=axes[36], figsize=(150, 8))
    dataset.plot(kind='scatter', x='West Mercia', y='Total Funding', ax=axes[37], figsize=(150, 8))
    dataset.plot(kind='scatter', x='West Midlands', y='Total Funding', ax=axes[38], figsize=(150, 8))
    dataset.plot(kind='scatter', x='West Yorkshire', y='Total Funding', ax=axes[39], figsize=(150, 8))
    dataset.plot(kind='scatter', x='Wiltshire', y='Total Funding', ax=axes[40], figsize=(150, 8))

The Y values are generated as: https://i.stack.imgur.com/EAV9z.png

Any help is greatly appreciated.

Keelan
  • 1
  • 2
  • I get this error: AttributeError: 'numpy.ndarray' object has no attribute 'ticklabel_format' – Keelan May 17 '21 at 22:54
  • It works but still uses scientific notation – Keelan May 17 '21 at 22:58
  • 1
    `axes` is a ndarray ... one option is a loop through `axes.ravel()`. – BigBen May 17 '21 at 23:01
  • `for ax in axes.ravel(): ax.ticklabel_format(style='plain', axis='y')`? – JohanC May 17 '21 at 23:09
  • See also [Prevent axes from being in scientific notation (powers of 10) using matplotlib in Python on semilogy plot](https://stackoverflow.com/questions/40336020/prevent-axes-from-being-in-scientific-notation-powers-of-10-using-matplotlib-i) – JohanC May 17 '21 at 23:12

0 Answers0