Trouble using latex in Matplotlib / Scipy etc -


Using matplotlib and scipy with my first attempt to create some scattered plots of my data (too many variables , Trying to see many things together). Here is working with some of my code that quite well ...

  matplotlib import * import h5py FileID = scipy import h5py.File ( '3DiPVDplot1.mat' * Import pylab Import numpy, 'r') # (to see the contents of: list (FileID)) group = FileID ['/'] CurrentsArray = group ['currents'] value IvIIIarray = group. ['IvIII'] value PFarray = group [. ' PF '] .Value growthTarray = Group [' growthT '] Price fig Pylabkfigure = () = Ax Figkadd_subplot (Lll) Cax Axkscatter = (IvIIIarray, GrowthTarray, PFarray, CurrentsArray, alpha = 0.75) cbar = fig .colorbar (cax) ax.set_xlabel ( 'Cu / III 'Ax.gr' (axis) 'ax.grid' (true) pylab.show ()  

I tried to change the code to include and interpret latex fonts, Although none of this is working for me here is an example attempt which does not work:

Import from import * import import matlotlib from imported * import h5py rc ('Text', usetex = true) rc ( 'font' family = 'serif') FileID = h5py.File ( '3DiPVDplot1.mat', 'r') # (the contents of the view: list (FileID)) groups = FileID [ ' / '] CurrentsArray = Group [' streams'] .Value IvIIIarray = Group ['IvIII']. Price PFarray = Group ['PF']. Value growthTarray = group ['growthT']. Price 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 ') to ax.set_ylabel (r'Growth T') ax.grid (True) Pylab.show ()

I'm using Faink install Python 26 spp Matlpletib etc. With the same package. I'm using iPython and manual work instead of scripts in Python.

Since I'm totally new to Python and Sippy, I'm sure I'm doing some stupid simple mistakes. Please give me the knowledge! I greatly appreciate the help!

For those who are just starting / mindplug, I found it useful I am currently using it as a way to find information ...

Create a file named simple_plot.py which includes the minimum script:

  to pylab Import * plot ([1,2,3]) show ()  

then run the following on the command line:

  Python Simple_plot.py - -Circle -Help  

The result I found:

< pre> $ HOME = / users / me CONFIGDIR = / user / m / Kmatplotib matplotlib data path /sw/lib/python2.6/site-packages/matplotlib/mpl-data the RC file load / sw / Lib / python2.6 / site-packages / matplotlib / mpl-data / matplotlibrc matplotlib version 0.99.0 verbose.level is useful interactive false units are false platforms Darwin / User / IMA / Meta / Lib / fonts list.KAV / SW / Using Font Manager Instance from Lib / Python 2.6 / Site-Packages / Species / Tezinu / Use: Set Module Set Sector has been excluded set backend Makosaks version unknown

I hope that it helps someone starting my way! :) Thanks for all the ideas on this!


Comments