I have been using this simple code to plot a .txt file.
import sys
import os
import numpy
from pylab import *
PlanetData = 'planetdata1.txt'
approx_distance_to_sun_(km),approx_velocity_(km/h)= numpy.loadtxt(PlanetData, unpack =True)
plot(approx_distance_to_sun_(km), approx_velocity_(km/h))
xlabel('Distance to sun (Km)')
ylabel('Approx. Velocity (Km/h)')
title('Distance to sun vs. Velocity')
show()
My .txt file is also uploaded here :
#approx_distance_to_sun_(km) approx_velocity_(km/h)
57909227 170503 # Mercury
108209475 126074 # Venus
149598262 107218 # Earth
227943824 86677 # Mars
778340821 47002 # Jupiter
1426666422 34701 # Saturn
2870658186 24477 # Uranus
4498396441 19566 # Neptune
5906440628 16809 # Pluto <- dwarf planet
Apparently I see no reason to get this error, can anyone help me fix the error?