I'm having some issues with my first attempts at using matplotlib and scipy to make some scatter plots of my data (too many variables, trying to see many things at once). Here's some code of mine that is working fairly well...
import numpy
from scipy import *
import pylab
from matplotlib import *
import h5py
FileID = h5py.File('3DiPVDplot1.mat','r')
# (to view the contents of: list(FileID) )
group = FileID['/']
CurrentsArray = group['Currents'].value
IvIIIarray = group['IvIII'].value
PFarray = group['PF'].value
growthTarray = group['growthT'].value
fig = pylab.figure()
ax = fig.add_subplot(111)
cax = ax.scatter(IvIIIarray, growthTarray, PFarray, CurrentsArray, alpha=0.75)
cbar = fig.colorbar(cax)
ax.set_xlabel('Cu / III')
ax.set_ylabel('Growth T')
ax.grid(True)
pylab.show()
I tried to change the code to include latex fonts and interpreting, none of it seems to work for me, however. Here's an example attempt that didn't work:
import numpy
from scipy import *
import pylab
from matplotlib import *
import h5py
rc('text', usetex=True)
rc('font', family='serif')
FileID = h5py.File('3DiPVDplot1.mat','r')
# (to view the contents of: list(FileID) )
group = FileID['/']
CurrentsArray = group['Currents'].value
IvIIIarray = group['IvIII'].value
PFarray = group['PF'].value
growthTarray = group['growthT'].value
fig = pylab.figure()
ax = fig.add_subplot(111)
cax = ax.scatter(IvIIIarray, growthTarray, PFarray, CurrentsArray, alpha=0.75)
cbar = fig.colorbar(cax)
ax.set_xlabel(r'Cu / III')
ax.set_ylabel(r'Growth T')
ax.grid(True)
pylab.show()
I'm using fink installed python26 with corresponding packages for scipy matplotlib etc. I've been using iPython and manual work instead of scripts in python.
Since I'm completely new to python and scipy, I'm sure I'm making some stupid simple mistakes. Please enlighten me! I greatly appreciate the help!