title: ValueError: x and y must have same first dimension, but have shapes (10,) and (1, 10)
body: <p>I need to plot a scatter plot using data from an excel sheet. I am not that familiar with numpy so I did basic python functions. If there is a way to convert the code easily with numpy that would be awesome. I have two arrays with 10 values each but I keep getting the error code that they must both be the same dimension.</p>
  
  <p>I have tried to convert the numpy arrays but it would always give me a weird value so I went back to my original function which is what I have submitted.</p>
  
  <pre class="lang-py prettyprint-override"><code>import random
  import numpy as np
  from numpy.polynomial.polynomial import polyfit
  import matplotlibimport random
  import numpy as np
  from numpy.polynomial.polynomial import polyfit
  import matplotlib
  matplotlib.use('TkAgg')
  import matplotlib.pyplot as plt
  import csv
  import math
  from collections import Counter
  
  galnum = []
  flagarr = []
  maskarr = []
  goodgal = []
  
  xval = np.array([3650, 4450, 5510, 6580, 8060, 9000, 12200, 21900, 35500, 44930])
  
  yval = []
  wave = []
  
  galoney = []
  galtwoy = []
  galthreey = []
  galfoury = []
  galfivey = []
  
  
  class Galaxy:
      def __init__(self, id , ra , dec , x , y , hawkiks_tot , k_flag , k_star , k_fluxrad , totmask , hawkiks , ehawkiks , vimosu , evimosu , vimosb , \
          evimosb , vimosv , evimosv , vimosr , evimosr , vimosi , evimosi , decamz , edecamz , fourstarj1 , efourstarj1 , hawkij , ehawkij , \
          irac1 , eirac1 , irac2, eirac2 , irac3 , eirac3 , irac4 , eirac4):
          self.id    = int(id)
          self.hawkiks_tot    = float(hawkiks_tot)
          self.k_flag = int(k_flag)
          self.totmask    = int(totmask)
          self.hawkiks    = float(hawkiks)
          self.vimosu    = float(vimosu)
          self.vimosb    = float(vimosb)
          self.vimosv    = float(vimosv)
          self.vimosr    = float(vimosr)
          self.vimosi    = float(vimosi)
          self.decamz    = float(decamz)
          self.hawkij    = float(hawkij)
          self.irac1 = float(irac1)
          self.irac2 = float(irac2)
          self.irac3 = float(irac3)
  
  
  allgal = []
  
  with open('/home/jacob/PHOTOMETRY/PHOTOM_CATS/SpARCS-0035_totalall_HAWKIKs.cat', 'r') as magfile:
      magplots = csv.reader(magfile)
      firstmagline = magfile.readline()
      for line in magfile:
          id , ra , dec , x , y , hawkiks_tot , k_flag , k_star , k_fluxrad , totmask , hawkiks , ehawkiks , vimosu , evimosu , vimosb , \
          evimosb , vimosv , evimosv , vimosr , evimosr , vimosi , evimosi , decamz , edecamz , fourstarj1 , efourstarj1 , hawkij , ehawkij , \
          irac1 , eirac1 , irac2, eirac2 , irac3 , eirac3 , irac4 , eirac4 = line.split()
  
          gal = Galaxy(id , ra , dec , x , y , hawkiks_tot , k_flag , k_star , k_fluxrad , totmask , hawkiks , ehawkiks , vimosu , evimosu , vimosb , \
          evimosb , vimosv , evimosv , vimosr , evimosr , vimosi , evimosi , decamz , edecamz , fourstarj1 , efourstarj1 , hawkij , ehawkij , \
          irac1 , eirac1 , irac2, eirac2 , irac3 , eirac3 , irac4 , eirac4)
  
          allgal.append(gal)
          goodflag = int(k_flag)
          goodmask = totmask
  
          flagarr.append(goodflag)
          maskarr.append(goodmask)
  
  
  for gal in allgal:
      if (gal.k_flag == 0) and (gal.totmask == 0) and (-2.5*math.log10(gal.hawkiks_tot) + 25 &lt; 23):
          goodgal.append(gal)
  
  
  random.seed(21)
  sample_list = random.sample(goodgal, k=5)
  print(sample_list)      #IDs: 2279, 3914, 3016, 4310, 2638
  
  for rangal in sample_list:
      yval.append(rangal.vimosu)
      yval.append(rangal.vimosb)
      yval.append(rangal.vimosv)
      yval.append(rangal.vimosr)
      yval.append(rangal.vimosi)
      yval.append(rangal.decamz)
      yval.append(rangal.hawkij)
      yval.append(rangal.hawkiks)
      yval.append(rangal.irac1)
      yval.append(rangal.irac2)
      print(rangal.id)
  
  galoney.append(yval[0:10])
  galtwoy.append(yval[10:20])
  galthreey.append(yval[20:30])
  galfoury.append(yval[30:40])
  galfivey.append(yval[40:50])
  
  print(yval)
  print(galoney)
  print(galtwoy)
  print(galthreey)
  print(galfoury)
  print(galfivey)
  print(xval)
  
  plt.plot(xval, galoney, '.')
  plt.xlabel('Wavelength Angstroms')
  plt.ylabel('f_nu')
  plt.title('Galaxy One: 2279')
  plt.show()
  
  </code></pre>
  
  <p>I'm expecting a scatter plot to appear, but all I'm getting is "ValueError: x and y must have same first dimension, but have shapes (10,) and (1, 10)". I have seen other errors like this on this forum, but they are dealing with numpy arrays. I was wondering if there was a way to not use numpy or if that is not possible, how to convert to numpy. Any help would be awesome! Thanks!</p>