Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Basic python question

  1. Aug 13, 2013 #1
    How do if you have a .csv file with 3 columns (independent, dependent, uncertainty in dependent variable), how do you make a graph so that the independent variable is the x-axis and the dependent is the y axis?

    All I've done is
    Code (Text):
    The graph I get seems to have plotted the independent variable as the dependent...as well as the other two columns
  2. jcsd
  3. Aug 14, 2013 #2
    hhhmmm...passing a single 2D array may be causing plot to plot all columns against the row index...try passing the individual columns explicitly, something like plot(data[0],data[1],'ko')
  4. Aug 15, 2013 #3
    Thanks, got it now. Looks like it's plotting everything correctly
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Basic python question
  1. Basic Python questions (Replies: 5)

  2. Simple python question (Replies: 2)

  3. Basic python help? (Replies: 3)

  4. Python 3 question (Replies: 4)