Reputation: 73
I have a json
[
{
"price": 649000,
"bedrooms": 3,
"bathrooms": 2.0,
"yr_built": 1984,
"sqft_lot": 3250.0,
"zpid": 15767255,
"address": "7036 Overlook Dr"
},
{
"price": 649000,
"bedrooms": 3,
"bathrooms": 2.0,
"yr_built": 1984,
"sqft_lot": 3250.0,
"zpid": 15767255,
"address": "7036 Overlook Dr"
},
]
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_json(json.dumps(json_data))
plt.scatter(data.price, data.sqft_lot)
Why is it that for x-axis data.price
the number ranges are only showing from 1-4 and not the actual price themselves?
Upvotes: 1
Views: 279
Reputation: 12496
The x axis actually shows the correct price values, but the axis is set to scientific notation. You can turn this notation on or off with matplotlib.pyplot.ticklabel_format
:
plt.ticklabel_format(axis = 'x', style = 'plain')
plt.ticklabel_format(axis = 'x', style = 'scientific', scilimits = (0, 0))
Upvotes: 1