world-ecoregion/biomes/plot.py

30 lines
744 B
Python
Raw Normal View History

from utils import *
import tensorflow as tf
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
tf.enable_eager_execution()
df = pd.read_pickle('data.p')
_, columns, _, _, dataset = dataframe_to_dataset_temp_precip(df)
xs = np.empty((3, 100))
ys = np.empty((100))
for i, (inp, out) in enumerate(dataset.take(100)):
xs[0][i] = float(inp[0])
xs[1][i] = float(inp[1])
xs[2][i] = float(inp[2])
ys[i] = float(out[0])
print(xs, ys)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.scatter(xs[0], ys, c='red', label='elevation')
ax.scatter(xs[1], ys, c='blue', label='distance_to_water')
ax.scatter(xs[2], ys, c='green', label='latitude')
#ax.scatter(xs2, 0, zs=0, c='blue')
plt.show()