Tom, please subscribe to matplotlib users at http://lists.sourceforge.net/mailman/listinfo/matplotlib-users and direct questions to the mailing list rather than me directly. I'm forwarding this question on to the list
---------- Forwarded message ---------- From: <[EMAIL PROTECTED]> Date: Sat, Jul 19, 2008 at 9:59 AM Subject: Multiple plots from multiple files in one figure? To: [EMAIL PROTECTED] John, Thanks for all the great work. I'm new to both matplotlib & Python, so please forgive any ignorance. I would like to plot multiple CSV files on a single set of axes. Specifically, I want to duplicate your Yahoo ticker data example, but plotting multiple tickers on the same figure so that I can compare performance. Is there some easy way to do this? Thanks for the help. Tom John Hunter-4 wrote: > > On 6/8/07, Lionel Roubeyrie <[EMAIL PROTECTED]> wrote: >> Hi John, >> very very interesting idea. >> Is there a way to add some extras informations on the records arrays >> columns, >> like the units or/and the desired labels for the resulting plotted lines, >> directly retrieved in the CSV files? > > It could be done, but my goal here is not to create a persistence > layer for record arrays, or a method of describing them or mpl labels, > but rather a way to easily import 3rd party CSV files into numpy > record arrays. I work with a lot of tab/space/ascii delimited files, > and found myself duplicating a lot of code importing them into record > arrays. This function is the distillation of that code. It would be > fairly easy to add designated rows for those who did want to decorate > their CSV files. I think it might be most useful to support a row > that provided a numpy dtype per column, or perhaps the name of a > converter function... > > One thing people coming from gnuplot miss is file plotting > functionality. I just added a function to pylab called plotfile which > uses the csv2rec functionality (with autolabeling etc) to plot data > from a file. Eg, > >>>> plotfile(fname, (0,5,6)) > > plots columns 5 and 6 against column 0. And > >>>> plotfile(fname, ('date', 'volume', 'adj_close'), > plotfuncs={'volume': 'bar'}) > > does the same using the names of the columns, using "plot" for > adj_close (the default) and "bar" for volume (customization from the > plotfuncs dictionary). The column names in either case are used to > create default x and y labels. > > The 2nd command produces the attached plot. This is just a first > pass, so if people want to see a different interface or have an > opinion what should be returned, or where this function should live > outside of pylab, feel free to comment or commit changes. > > JDH > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > Quoted from: http://www.nabble.com/record-array-and-date-support-tp11011990p11027947.html ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users