[Tutor] Created map after opening file

Betty Cruz elvclr at gmail.com
Thu Oct 20 00:31:11 EDT 2016


Hello, I'm new to python. I'm trying to create a map after reading a file.
I have downloaded python 3, anaconda, and pycharm.

I have written some code, but I'm having trouble reading the file...How do
I read the file so that it reads the data and makes the map? My data is
only in rows...the first row are the x's and the second row are the y's.

Any help would be appreciated. I have tried to run the program. but I just
get an error, saying that the directory for the file is not found.

code:

import numpy as np

import matplotlib.pyplot as plt


data= np.loadtxt('mat.dat')

#data = np.genfromtxt('map.dat')


# plot the first column as x, and second column as y
#pl.plot(data[:,0], data[:,1], ’ro’)
#pl.xlabel(’x’)
#pl.ylabel(’y’)
#pl.xlim(0.0, 90.0)
#pl.ylim(10.0, 80.0)
#pl.show()


More information about the Tutor mailing list