Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Image

Matplotlib For Python Developers 119

Craig Maloney writes "Ever since there was a collection of numbers, it seems that invariably someone will want a graph of those numbers. There are literally hundreds of different styles of graphs, and almost as many programs and tools to make those graphs. Matplotlib, a library and toolkit for the Python language, provides an easy and effective way to make some impressive graphics with little more than a smattering of Python. Matplotlib for Python Developers is equally impressive at distilling the core set of features of Matplotlib in a way that shows the reader how to get the most out the Matplotlib toolkit." Read below for the rest of Craig's review.
Matplotlib for Python Developers
author Sandro Tosi
pages 291
publisher Packt Publishing
rating 9/10
reviewer Craig Maloney
ISBN 978-1-847197-90-0
summary A comprehensive overview of the powerful Matplotlib Python library
Matplotlib for Python Developers begins with the customary introduction to the Matplotlib library. It includes where to download Matplotlib, as well as brief installation instructions for both Linux, Macintosh, and Windows platforms. The book then quickly moves to the next chapter, where the basic library functions are presented, via the interactive iPython shell. Each section of the chapter introduces a new part of the graph, with items like titles, grid lines, and labels being explained clearly and concisely. Also briefly presented are other useful libraries like numpy, as well as the various back-ends that Matplotlib supports. Chapter 3 continues the even pace, presenting more plot styles, and plot types, including polar graphs. These two chapters cover the fundamentals of Matplotlib very well, with each step clearly marked by what the graph should look like once completed.

The next chapter introduces more advanced plotting concepts that Matplotlib is capable of handling. The chapter begins with the three ways that Matplotlib may be used (The pyplot module, pylab, and the Object Oriented interface). From there, the book delves into subplots, multiple figures, additional axes, logarithmic axes, date plotting, contour plots, and image plots. Also included are sections on using LaTeX and TeX with Matplotlib, both for exporting graphs, as well as using TeX inside plots via Mathtext. By the end of the chapter, I felt very comfortable with the environment and the capabilities of Matplotlib, both as an interactive environment, and as a module for my own programs.

The next four chapters cover integrating Matplotlib with GTK+, QT4, wxWidgets, and web-based environments. The chapters for GTK+, QT4, and wxWidgets each begin by presenting a basic overview of the toolkit, and why one might want to use that particular toolkit. Next, the book shows how to embed a Matplotlib figure in a window, both with static and real-time data input. The book then shows how to use the toolkit's builder with Matplotlib (Glade for GTK+, QT Designer for QT4, and wxGlade for wxWidgets. The chapter on web development veers slightly from this format by showing several examples of using CGI and mod_python with Matplotlib before showing how to use Matplotlib with Django and Pylons.

The last chapter pulls together some "real world" examples together for the grand finale. The examples clearly show how Matplotlib would work for such plotting Apache web logs, fitting curves, and plotting geographic data. The geographic data plotting uses an additional module called basemap, which allows for plotting precisely on a map. This example floored me with the amount of power that Matplotlib possesses.

Overall, I found this book to be informative, without a lot of fluff. The organization of the book sometimes dipped into a chaotic presentation of "oh, look at this", but overall the author kept a very even pace, with clearly defined goals and clean resolution of those goals. Matplotlib for Python Developers is definitely a book that I would pick up to refresh my memory for using Matplotlib. The asking price is a bit steep for book that is just shy of 300 pages, but overall I highly recommend it for anyone looking to get started with this exceptional library. I'd also recommend it for anyone looking for alternatives to some of the other plotting packages available. Matplotlib is quite powerful, and Matplotlib for Python Developers makes this power very accessible.

You can purchase Matplotlib for Python Developers from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

*

This discussion has been archived. No new comments can be posted.

Matplotlib For Python Developers

Comments Filter:
  • by Animats ( 122034 ) on Wednesday May 12, 2010 @01:28PM (#32184956) Homepage

    This is something that ought to be one chapter in a Python book, not another boat-anchor of a standalone book.

    • Because you don't become a matplotlib master by doing 12,000 things, you become a matplotlib master by doing 4 things 12,000 times.

      Or something. Hell man, I agree with you.

    • Have you actually used matplotlib? Like with any plotting package (or at least all the ones I've ever used) there are some subtle but important details where a 20 page handout just wouldn't do. You don't like the book, don't buy the f'ing thing.

      - kg

    • Re: (Score:3, Informative)

      by goombah99 ( 560566 )

      Matplotlib which I use a lot, has really sucky documentation so this 250 pages would amount to basically all the documents. Additionally, you have to realize that matplot lib is not one coherent entity. it's a mish mash of many many things in numberical analysis much of it having to manage legacy cases and pertending to ape matlab syntax. So there's lots of special cases to cover.

      On the otherhand I really have ot wonder sometimes if matplotlib is a dead project. All of the standard distro's have 3D pl

      • by ceoyoyo ( 59147 )

        If your chosen python packager doesn't do an adequate job of including matplotlib then install it yourself. It's a double click (or equivalent) on the major platforms. Certainly not dead.

        • If your chosen python packager doesn't do an adequate job of including matplotlib then install it yourself. It's a double click (or equivalent) on the major platforms. Certainly not dead.

          ha! have you ever tried to install the 3d packages or any of the advanced math stuff. it's most definitely not easy. it's dependency hell. hence the package manager is the only way that seems to work. It is true you can find a few binary distros out there. but again everything I said is true: the 3D depends on unmaintained packages and you can't find them in all distros. As a result it makes distributing code to other scientist a problem.

          • Re: (Score:3, Informative)

            by ceoyoyo ( 59147 )

            Yes, I have. The math stuff is just fine. The hardest part is usually installing LaTeX. The 3D stuff is unmaintained. There was some initial interest in it a few years ago and then it sort of died because there are other, better ways to plot in 3D. Even so, I believe the VTK integration still works reasonably well, and it just requires installing VTK and one other package. You might have a point that the third-party 3D addons to matplotlib are dead, but matplotlib itself certainly isn't.

            The best way t

            • The best way to distribute a Python environment is to tar the whole thing up and send it to whomever. An alternative is just to tar up the site-packages directory. For a long time I had a separate, easily accessible site-packages that could be packaged and distributed to everyone in the lab on a regular basis. On OS X you can even make a pretty double click installer in about five minutes.

              I'd love some advice on this if you would care to share. I'm always afraid that when I do an install it will end up putting something into a tree I'll miss in a tar ball. The other problem is that when I'm using a distro like fink, I'm not sure how to make sure I include everything I need to send python in a self contained way without sending all of fink. Tips wold be apreciated. I'm not a python nuts and bolts genius, more of an end user.

              • by ceoyoyo ( 59147 )

                Since you mentioned Fink I'm assuming you're on a Mac?

                On any Unix it's a good idea to do a Python install in someplace other than the system Python location. Particularly on the Mac. Some system scripts are written in Python and it's a good idea not to mess with the Python they depend on.

                The standard way to do an install on the Mac is as a framework. If you're building Python from scratch, you use the flag --framework-install. I haven't done that for a while since the binaries available from python.org

    • by Hatta ( 162192 )

      If you can't think of enough ways to graphically display information to fill a 250 page book, that says more about your lack of imagination than the utility of a plotting library.

    • by gnalle ( 125916 )
      Is anybody working on a book about scipy? I would buy it.
  • *yawn* (Score:2, Funny)

    by Anonymous Coward

    Wake me up when someone writes about Sillyplotadlib for Monty Python developers.

  • is it my imagination or has this been reviewed on slashdot before?
  • by Thelasko ( 1196535 ) on Wednesday May 12, 2010 @01:56PM (#32185252) Journal
    I've heard quite a few people here on Slashdot talk about how useful Python is as a substitute for MATLAB. Honestly, I don't get it. Python is trying to be a language for both hard core programming, and scientific programing. These two disciplines have very different needs. I don't want to load 20 modules before I can begin coding. I just want to input my algorithm and get a result I expect (not 5/2=2).

    It seems that version 3.0 has gotten better for us scientific users. However, I think the programmers out there are now dissatisfied.
    • by maxume ( 22995 )

      Why are you anthropomorphizing?

      The core Python dev team is probably mostly agnostic towards changes that benefit scientists, especially if there are no costs to programmers, or huge amounts of maintenance.

      Another group of people is working hard to make tools for doing science in Python.

      Switching over to doing float division by default isn't that huge a change, and it is aimed at beginners, not scientists. If number literals had been converted over to being interpreted as rationals, maybe you'd have an argum

      • Re: (Score:3, Insightful)

        by Capsaicin ( 412918 )

        Why are you anthropomorphizing?

        Because it's a narrative device that can be used effectively to communicate. You didn't have any trouble understanding that "python" in that context stood for the python development community, did you? You didn't seriously think he was ascribing a human like intelligence to a language specification, did you? That anthropomorphism avoids clutter and actually increases readability, and after all, readability counts. :P

        That being said, I have to agree with you. Part of the

        • by maxume ( 22995 )

          I asked the anthropomorphism question because it seemed like maybe he was taking the device a little too literally, treating the community as a monolithic block. It was a device of my own.

    • by markovg ( 991625 )

      I've heard quite a few people here on Slashdot talk about how useful Python is as a substitute for MATLAB. Honestly, I don't get it.

      MATLAB is a great product, and what it does it does well. But sooner or later you grow out of it, depending on how far you need to push it, and how much previous experience you have with real programming languages. When that day comes, Python is there waiting, and its can be sooo refreshing.

      • I'd also add that when it comes to shipping code to a client, pointing them to a Python download vs. shelling out for a MATLAB license can be a factor as well. I like MATLAB but there's no denying there's a degree of sticker shock with it.

      • Re: (Score:3, Informative)

        by matt_martin ( 159394 )

        Not even quite sure MATLAB "does what it does well". Its usually a great way to get started, especially if you don't quite know what you are doing. But then I often find myself wondering why I am working around bugs and re-writing functions in a $10k software package. Moved almost everything to python/numpy/scipy/Matplotlib over a year ago and really haven't looked back.

        Here's one thing that Matplotlib should not have replicated from MATLAB: insane memory usage.
        Please folks, lets get it under control: 1G of

        • In my experience, while Matlab is a great way to get started, the code you produce in Matlab tends to be difficult to port across nicely, even to Python, because Matlab just does stuff in such a unique and honestly, bizarre way. I agree, Matlab doesn't really do anything well in my opinion, hell I am a TA for first year Matlab classes at my uni and I hate every minute of it.

      • by 2.7182 ( 819680 )
        Actually, I think Matlab survives a lot based on urban legend and another strange thing - it is easy to make plots. Like Maple and mathematica, the simple environment is really what keeps it going. Try writing some basic linear algebra operations in C++ with some not too fancy methods and you will find Matlab is no faster, or even slower. If you are already functional in C or Python or whatever, steer clear of Matlab. Unless perhaps there is some reason you want to use it to design hardware controllers. In
    • Re: (Score:2, Insightful)

      by kolabaum ( 1810138 )
      I would consider Octave to be a much better substitute for MATLAB rather than Python for those who just wants to 'get the job done'. That being said, however, I think anyone who uses Python for scientific work (for whatever reason) would greatly appreciate Matplotlib due to the resemblance to MATLAB's built-in plot functions.
      • Re: (Score:3, Informative)

        That echoes my experience. I generally prefer Chaco [enthought.com] for plots in Python since it seems to handle large datasets better than matplotlib (although matplotlib seems more functional), but matplotlib is comfortable for MATLAB users. I'm working on a SciPy project with a couple of MATLAB refugees and they love matplotlib.

      • I disagree very strongly with Octave being a better alternative. Octave is just an open source matlab clone, so if all you want is to run your old scripts with only minor modifications and without paying anyone, octave might be the way to go. Other than that, plotting in Octave sucks pretty hard, you basically have to learn Gnuplot from scratch. Even matlab itself is not a star in plotting, after 15+ years you still have to be a guru to get publication-style plots, but it is already miles better than octa
    • Re: (Score:3, Insightful)

      Does loading those twenty modules hurt you if, by virtue of their being in common use, there is some trivial automated way of doing it?

      With the exception of people writing bare-metal assembly for microcontrollers or something, pretty much everyone who sits down to write some code has huge swaths of pre-written stuff loaded for them. The only difference is how much of that happens automatically, by default, and how much you see and do yourself.

      If the science types happen to like python for some syntact
      • Exactly. Sage, for instance, pretty much does that and adds in a lot of other mathematical and statistical programs through various interfaces (http:www.sagemath.org).
    • I've heard quite a few people here on Slashdot talk about how useful Python is as a substitute for MATLAB. Honestly, I don't get it.

      I think there are many programs built on MATLAB which could be as easily and effectively built on Python and associated libraries. I do not see scipy/numpy/ipython/matplotlib as a dropin replacement for the MATLAB interactive environment, because they are different (even if equally capable).

      Python is trying to be a language for both hard core programming, and scientific programing.

      I do not feel like it is trying to be either. I think it is trying to be as suitable as it can for both of those things without compromising elegance.

      I don't want to load 20 modules before I can begin coding. I just want to input my algorithm and get a result I expect (not 5/2=2).

      Since I can trivially make a file "mystartup.py" with import statemen

    • by radtea ( 464814 ) on Wednesday May 12, 2010 @02:21PM (#32185474)

      I just want to input my algorithm and get a result I expect (not 5/2=2).

      What result do you expect from 5/2? I expect 2... 5/2 == 2 in C, C++ and FORTRAN (I think... I don't write much FORTRAN code these days...)

      Python does an excellent job of making both useful scientific functionality available via scipy and numpy and a wealth of other toolkits, and at the same time allowing us to package stuff up in usable applications. It provides all the real-world applications language facilities that MATLAB, Mathematica, R, etc lack.

      I deal with people who "code" in those environments all the time, and they are not my peers: they have fundamentally failed to grasp almost everything important about programming, from design principles to documentation. For someone who knows how to write software--which MATLAB et al "programmers" do not, as a professional understands the term--Python is pretty much ideal for expressing algorithms and wrapping them in useful applications.

      • Re: (Score:2, Informative)

        by WeatherGod ( 1726770 )

        What result do you expect from 5/2? I expect 2... 5/2 == 2 in C, C++ and FORTRAN (I think... I don't write much FORTRAN code these days...)

        Just watch out in python 3.0, this will change. Because of python's duck-typing, you can never be certain if you were getting an integer or a float, and so it is possible to get different behaviors implicitly. Because python's mantra is "Explicit is better than Implicit", python 3.0 will only do integer (called floored) division when you do '//'.

      • by ceoyoyo ( 59147 )

        It doesn't matter I'd you grasp basic code design or not, Matlab et al simply don't support that sort I thing, or have support poorly grafted on afterward because they were never designed for real coding. I say this as a scientist who uses everything from assembler to Python and has had the unenviable task of figuring out what someone else's thousand line long matlab programs were doing.

      • Scicos might be what you are looking for
    • Python's dynamic object orientation allows it to be used for a wide range of rapid development in many fields.
      I use it for scientific programming. While it does not have as many libraries as matlab or R, it is great because I can call R routines from python plus does things like threading and complex file manipulation, that the others do poorly.

      Python is not bad numerically, you just have to be clear about what objects you are using when. If you don't want 5/2=2, then use 5./2.

    • Re: (Score:3, Interesting)

      Wake me when there is something even close to replace Simulink. Matlab is cool and all, but the real power of the program is Simulink.

      • Depending on your requirements, Scicos might be what you are looking for.

      • Why? Simulink sucks, what on earth would prevent you from doing that stuff in raw Python, or a good micro language? Do you think control systems really need a $10k package to operate? Simulink is great for prototyping, and for engineers who can't program, thats about it I reckon.

    • by honkycat ( 249849 ) on Wednesday May 12, 2010 @02:45PM (#32185762) Homepage Journal

      I use Python for scientific computing and much, much, much prefer it to MATLAB. Most of what I do does not require sophisticated library routines, and the sophisticated stuff I do need generally either aren't common enough to exist for MATLAB or are quirky enough that I wouldn't trust someone else's library to have the details right. Thus, the typically cited advantages of MATLAB are not there for me. Python provides a much better thought out programming language. It's sometimes a bit less convenient for interactivity, but really I got used to using it (plus matplotlib an numpy) quickly and I have not felt the urge to move back to MATLAB for quite some time. Very occasionally I'll pop in to do a crude curve fit, but not often.

      The needs of scientific programming and hard core programming (whatever exactly that means) are not so different. As for not wanting to load modules, um, what? I can think of reasonable complaints about Python, but I don't consider that among them. That reeks of "it's different so I don't like it," which is not a well thought through reason.

    • Re: (Score:3, Informative)

      > I don't want to load 20 modules before I can begin coding. I just want to input my algorithm and get a result I expect (not 5/2=2). You might want to try Sage (sagemath.org [sagemath.org] and sagenb.org [sagenb.org]). It's Python, but it fixes the "5/2" issue and preloads numerous modules.
      • by RichardJenkins ( 1362463 ) on Wednesday May 12, 2010 @06:16PM (#32187806)
        Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55)
        [GCC 4.4.1] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        >>> 5/2 #Diving integers in Python 2.6 gives an integer
        2
        >>> from __future__ import division
        >>> 5/2 #Things work differently in the future
        2.5
        >>> 5//2 #You can use a double '/' to explicitly force an integer in Python 3
        2
      • Has anyone actually worked with Sage? How is it? How / when did you find it superior? Pros/cons?

    • Re: (Score:3, Insightful)

      by mangu ( 126918 )

      I don't want to load 20 modules before I can begin coding.

      That's why I don't like Matlab. Not only you have to import every single function you use, but each function comes in a separate file. And when you find the function you need on the web, you have to shell out an extra $5k to get the libraries it depends on.

      My only worry about Python is that version 3 abomination. They not only managed to make each change towards a more complicated way to use, but also deprecated such a basic thing as string formattin

      • Re: (Score:3, Informative)

        by BusterB ( 10791 )
        When did they get rid of C-style string formatting? That's news to me.

        bcook@bcook-box:~$ python3
        Python 3.1.2 (r312:79147, Apr 15 2010, 15:35:48)
        [GCC 4.4.3] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        >>> "%d %s" % (1, "Hello")
        '1 Hello'
        • by mangu ( 126918 )

          The original plan was to completely eliminate the '%' string formatting operator by version 3.2

          I don't know if they are still committed to this, since, as I mentioned, this is one of the stupidest decisions one can imagine. But they still mention in the str.format method documentation that "This method of string formatting is the new standard in Python 3.0, and should be preferred to the % formatting described in String Formatting Operations in new code."

          In the PEP-3101 documentation the abstract says: "Thi

      • by Adys ( 1274540 )
        They aren't getting rid of C-style string formatting. They are adding a format method to strings, which uses a different syntax. The current modulo override (str % format) is staying, and they haven't decided whether they will one day get rid of it.
        • Yes they are [python.org]. Skip down to the section Changes Already Present In Python 2.6. String formatting is deprecated in favor of their new horrible way. They're going to try to get rid of the old, good way. I won't switch to 3.0 unless they give up on that, but so far they haven't.
    • by smaddox ( 928261 )

      What kind of a scientist doesn't include at least 2 significant digits?

      >>> 5.0/2.0
      2.5

      Problem solved

    • For math:

      from __future__ import division

    • Re: (Score:2, Interesting)

      by brunos ( 629303 )
      Hi, I see your point: Python is getting a lot better for scientific use, maybe not so much due to the changes in 3.0 but rather because the community has grown (e.g. Python(x,y), Enthought). There are a few things that make Python what I use most of the time for scientific work: - The language is better thought out i.e. the Matlab tradition of having one function per file is just annoying. - The quality of the old Fortran algorithms which scipy wraps is consistently better than that of Matlab functions e.
    • by jipn4 ( 1367823 )

      I don't want to load 20 modules before I can begin coding. I just want to input my algorithm and get a result I expect

      In the real world of scientific programming, that's often not enough. A lot of scientific software needs to collect data from instruments, parse, format, deal with databases, perform visualizations, present user interfaces to lab assistants, interface with foreign libraries, etc. It needs to be unit tested, regression tested, maintained, reused, refactored, etc. Scientific libraries ofte

  • Python threads seem to bring the C++ flamers out of the woodwork. Just so you know, Matplotlib is written in C++. I happen to like both languages.

    • Re: (Score:1, Insightful)

      by Anonymous Coward
      Who is flaming C++ here? You are bringing up some imaginary adversaries which you then start to debate, like you are talking with the voices in your head. If you have some real comments to make, post a comment to someone else's post, and do not start a new thread.
  • by Anonymous Coward
    At one point I was trying to decide which graphics plotting library I wanted to get proficient with. I considered mathplotlib but I eventually decided on R + ggplot [had.co.nz] and am very satisfied. Some examples here [google.com]. True, I was doing mainly statistical stuff so the R connection wasn't a liability. But I like the philosophy of ggplot: the "gg" stands for "grammar of graphics". The library doesn't demand that you adjust every little thing separately to make interesting graphs; it gives you a variety of concepts
  • Python..meh (Score:1, Funny)

    by Anonymous Coward

    No word yet if the chapters are indented properly.

  • by yerM)M ( 720808 ) on Wednesday May 12, 2010 @04:40PM (#32187028) Homepage
    It's too bad they didn't use any in the book.

    I have used matplotlib for journal plots and actually gave away a copy at a conference I ran so I have to say I really do like the book overall, but if you scan through the pages, you might be turned off.

  • In Defense of Matlab (Score:3, Informative)

    by tobiah ( 308208 ) on Wednesday May 12, 2010 @06:09PM (#32187746)

    Python has it's strengths, but there are good reasons Matlab is so widely used:

    Price: There is a price to everything, Matlab's is up-front and what you get is guaranteed support and development. If there is a bug or serious shortcoming you know someone is working on it like their job depends on it.
    Graphics: Matlab has the most feature-rich and usable graphical environment of any of its would-be competitors, none of which do 3D well.
    Speed: Core Matlab operations are highly optimized in C; properly vectorized Matlab code will run much faster than what most programmers could write in C themselves.
    Interoperability: Java and .Net calls can be made from the Matlab command line, integrating compiled C is well-supported and very straightforward. Python can do these things, but it's not automatic or well-documented.
    Documentation: it's there, and it's good.
    Dev Environment: the debugging tools, profiler, and lint integration are really helpful.

    • Speed: Core Matlab operations are highly optimized in C; properly vectorized Matlab code will run much faster than what most programmers could write in C themselves.

      I'm not disagreeing with you per se, as I'm not extremely experienced in Matlab, but my empirical observations (working on my own code here) have shown that this isnt really true. I have recently written identical pieces of code in Matlab and Python/Numpy, with the same level of vectorisation I spose, and found Numpy to be significantly faster a

      • This begs to differ if python is really interpreted anymore? Java and .NETs CLR use bytecode and JIT so the speed differences are not that big or at all unless you continuously load and unload large amounts of code. If its only a 10% difference then upgrading your cpu can bring the same effect. I wonder how fast python is and what kind of compiler or interpreter it is as well.

      • by tobiah ( 308208 )

        It's not Matlab competing with raw Python in your example, but with the compiled C and Fortran of NumPy. They're going to be about the same speed. Matlab and Python are both interpretive languages, so pretty slow. However, the slowest most intensive parts have been compiled to get the "best" of both worlds, ease of use and speed.

        • Wait, wait, wait. Are you saying "Yes, NumPy and Matlab work the same way, so no advantage to Matlab," or are you saying "the comparison isn't fair because compiled-C/Fortran routines being called by Numpy are being compared to compiled-C/Fortran routines being called by Matlab?"

          If you're saying the latter, you need to know that the two software packages pretty much work the same way, you write a quick script and the array (vector) data is passed into a compiled routine to munch on and only when the routine

          • In this sense, Matlab and NumPy are THE SAME.

            Not the same, but very similar. As far as I'm aware Matlab uses a Fortran backend, while Numpy uses C. Now thats kind of picking at straws, but my point is honestly I don't think Matlab is faster than Python.

            Either way I guess it depends on your toolbox in Matlab, or library in Python. Given both I'd choose Python every day of the week.

      • Re: (Score:3, Interesting)

        by Vireo ( 190514 )

        Speed in interpreted languages such as Python and Matlab depends strongly on what it is doing exactly, and how it is done. For example, both Matlab and the numpy Python module use external, pre-compiled, and highly optimized basic linear algebra subroutines (BLAS) for things like matrix multiplication. Matlab ships with several different BLAS, but it's even possible for Matlab to use the ATLAS BLAS which numpy uses.

        So the speed would be the same in that case, assuming both your Matlab installation and numpy

    • I own a copy of Matlab, but am moving more and more stuff out of it.
      It integrates with command line very poorly (on windows).
      The java interface parts look like shit.
      The language sucks for real development work.
      They want to pay them a fee to retain the future ability to purchase toolboxes, even though I don't want support.
      The only thing I am still using is the griddata function because it is better than octaves.
      Most of my work is now in python with gnuplot.
      • by tobiah ( 308208 )

        Gnuplot is solid, I'm surprised I don't hear of it with Python. How do you connect them? My impression was there isn't a good link available.

        • Re: (Score:1, Interesting)

          by Anonymous Coward

          For me, gnuplot is the best plotting program out there. It's very easy to use from python using Gnuplot.py (http://gnuplot-py.sourceforge.net). It essentially starts a gnuplot session that sends it commands through a pipe. You can choose if data is sent through a FIFO or temporary files (slower, but required for some of the interactive plotting features).

          In a nutshell:

          import Gnuplot as gp
          g=gp.Gnuplot()
          g.plot("sin(x)")

          Conversion of most sensible python data types is done on the fly:
          g.plot( [(x,x**2) for x in

    • Not to mention using it with simulink, which is pretty impressive.
      Also the differential equation solvers are pretty smart, if you need them.
      Plus we use it with the symbolic math toolbox, which is very powerful and as far as I know there is no free replacement for it. Not that I would expect there to be, symbolic math is pretty hard to program I should think. The last free one I tried didn't even know that cos^2+sin^2 == 1

      • Look into the libraries that Sage Math uses for near-Mathematica symbolic manipulation. Or just use Sage (which is built on top of Python).

        Simulink I haven't found a great replacement for within Python, but graphical programming is often more of an impediment than a help for me. For layout of one-off control systems, it was nice, but I've just gotten too efficient with text editing (and I'm to the point that I can visualize what's going on) to want to worry about connecting wires, double-clicking, changing

    • by Xyrus ( 755017 )

      Price:

      That's a positive? You can't even get a price unless you create an account with them and "login". Unless whoever you're doing the research for provides you with the budget or has it someplace you can get to it (and has bought the seats so you aren't fighting everyone for your chance to use it) you're going to be shelling out some cash.

      As far as working on bugs or shortcomings, your not guaranteed anything. Like any other product your bug/feature/whatever goes into a priority queue. If you're a lowly grad st

    • Check your comparison facts:

      1) Near-compiled speed with a scripting front-end? Try NumPy out, it works the SAME WAY as Matlab (vectorize your code and it runs at near-compiled speed). There isn't any secret to how Matlab does things, it's just what they've put together into one package and the loyal userbase that keeps them going.

      2) UI's: iPython or Spyder are user interfaces achieving similar goals to that of Matlab (I prefer the former as I'm a command-line junkie, but the latter will make you believe you

    • by Vesvvi ( 1501135 )

      Graphics: Matlab has the most feature-rich and usable graphical environment of any of its would-be competitors, none of which do 3D well.

      I'm interpreting that to say that Matlab does a better job at 3D than the competitors, which is exactly the opposite of my experiences.

      I work 100% in Python/Scipy/etc, and my brother does 100% Matlab. He had to come to me for suggestions when Matlab failed to handle visualization of his extremely large 3D datasets (I can't comment on whether he really had exhausted Matlab's functionality for that purpose). Although it's true that Matplotlib has pretty poor 3D support, Python gives you many more avenues: B

    • Re: (Score:3, Interesting)

      by Vireo ( 190514 )

      A few quick comments on this well-informed post...

      Price: you're right here, Matlab is expensive and is locking you down, but at least you get very decent support from The MathWorks.

      Graphics: Matlab has a huge library of very usable graphics functions. However it is nonetheless lacking in certain areas. GUIs is one of them (you can only embed Matlab graphics in a Matlab GUI, and the various methods to build a GUI in Matlab mostly sucks compared to what is possible outside of Matlab). Also, while Matlab figur

      • by tobiah ( 308208 )

        Graphics: Matlab has a huge library of very usable graphics functions. However it is nonetheless lacking in certain areas. GUIs is one of them (you can only embed Matlab graphics in a Matlab GUI, and the various methods to build a GUI in Matlab mostly sucks compared to what is possible outside of Matlab).

        It took me a long time to figure out Matlab graphics. Their "guide" function is nice for mocking up GUIs, but is not anything you want to use for making them. Handle graphics should be used the way they were originally designed; as OO objects managed by set and get. Since then I haven't found anything I want to do with Matlab graphics that I can't. It is total control.

        Dev environment: All functions in all toolboxes are in the same namespace in Matlab, and it's beginning hard to find creative new names for my own function, all the most if they replicate some Matlab's built-in capability. Python's namespace / module imports solves this problem very nicely.

        Yup, been an issue for awhile. However the 2008 class-definition and package-definition components go a long way to address it. They're movin

    • You missed a big one:
      Toolboxes: The set of toolboxes available for MATLAB is rich, capable, and documented. Yes, if I hack enough things together there are packages available for other languages that can do some of what MATLAB toolboxes can do. But at the end of the day, when I need to design filter coefficients, find a stabilizing gain, etc. I turn to MATLAB because it's there, I don't have to hunt for the packages, the results are repeatable on a different machine with a different version of MATLAB, and
  • I might ditch Matlab completely, especially given what I've read here, because I hate its license manager, it's expensive, and its performance on Macs is pretty sorry. Expenses can grow fast if you try to collaborate and nobody uses the same toolboxes. However, its syntax is intuitive to the mathematically inclined, it handles large arrays efficiently (!), and its GUI is really nice. I prefer Igor Pro for scientific graphing, but its syntax is a little more complex, it's limited to 4D arrays, and it's compi
  • The ad attached to this story's RSS summary is for reptile cages.

Avoid strange women and temporary variables.

Working...