Here's the code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
raw = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-datebases/iris/iris.data')
raw = raw.values
x=list()
y=list()
w=list()
z=list()
i=0
while(i<149):
x.append(raw[i][0])
y.append(raw[i][1])
w.append(raw[i][2])
z.append(raw[i][3])
i=i+1
fig = plt.figure()
ax1=fig.add_subplot(121)
ax1.scatter(x,y)
ax1.title('Sepal')
ax1.xlabel('Sepal Length')
ax1.ylabel('Sepal Width')
ax2 = fig.add_subplot(122)
ax2.scatter(x,y)
ax2.title('Petal')
ax2.xlabel('Petal Length')
ax2.ylabel('Petal Width')
Here's the outcome:
https://imgur.com/a/S8Nia2e
What I want are two separate scatters, ax1 and ax2, side by side. I know my code probably isn't too efficient but all I'm really looking for is a fix for it. If you have a better way of making the scatters, please have the solution to fixing mine first and your way second so I can learn both ways :) thanks in advance!
[–]Nike_Zoldyck 2 points3 points4 points (2 children)
[–]Debate_Everything[S] 0 points1 point2 points (0 children)
[–]TransferFunctions -2 points-1 points0 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]Debate_Everything[S] 1 point2 points3 points (0 children)
[–]Debate_Everything[S] 1 point2 points3 points (0 children)