Python Graphing Utilities.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Kern

    #16
    Re: Python Graphing Utilities.

    Bill Mill wrote:
    [color=blue]
    > Tha's cool, I saw what you wrote. First off, I wasn't sure what you
    > meant by "hardcopy", so I thought I'd let you know that matplotlib has
    > PS output. Second, the page I linked to talks about all the font-type
    > features of matplotlib, which I thought might interest you. Having not
    > gotten funky with them, I cannot vouch for their quality.[/color]

    They're not TeX-quality. Yet.

    A pslatex backend certainly would be interesting. A Gnuplot backend
    would probably not be feasible. Does it expose its raw drawing operations?

    --
    Robert Kern
    rkern@ucsd.edu

    "In the fields of hell where the grass grows high
    Are the graves of dreams allowed to die."
    -- Richard Harter

    Comment

    • Torsten Bronger

      #17
      Re: Python Graphing Utilities.

      Hallöchen!

      Robert Kern <rkern@ucsd.edu > writes:
      [color=blue]
      > [...]
      >
      > A pslatex backend certainly would be interesting. A Gnuplot
      > backend would probably not be feasible. Does it expose its raw
      > drawing operations?[/color]

      Probably not raw enough, but I don't know how basic matplotlib
      wants it to be. You could switch the axes off and draw everything
      as lines using plot coordinates, but I don't know how sensible this
      would be.

      On the other hand, the "pslatex" output of Gnuplot is one of the
      very few things that hold me there. If matplotlib produced
      something equivalent, (at least) I wouldn't call for a Gnuplot
      backend anymore.

      Tschö,
      Torsten.

      --
      Torsten Bronger, aquisgrana, europa vetus

      Comment

      • Fernando Perez

        #18
        Re: Python Graphing Utilities.

        Torsten Bronger wrote:
        [color=blue]
        > Hallöchen!
        >
        > Fernando Perez <fperez.net@gma il.com> writes:
        >[color=green]
        >> [...]
        >>
        >> And I'd also second the matplotlib suggestion, to which I've by
        >> now fully switched after years of faithful gnuplot usage.
        >> Matplotlib is very good, has an active development community, and
        >> it is designed from the ground up not only as a library for
        >> rendering plots to screen/disk, but also for embedding into guis
        >> (with support for Tk, WX, GTK, QT and FLTK).[/color]
        >
        > Why not for Gnuplot, by the way?
        >
        > On sceen, matplotlib looks extremely good, however, I still need
        > Gnuplot for the hardcopy version[*]. It *seems* to me that the
        > programming interfaces are quite different, so a Gnuplot backend for
        > matplotlib would be helpful for me.[/color]

        Well, it's true that the latex-type (called mathtext) support in matplotlib is
        not really up to par with true latex (kerning is off in places, mixed
        text/math doesn't work well, etc). I've been willing to live with it so far,
        but an alternative option is to use the PS backend and then play psfrag
        tricks. I've yet to experiment with it, but it might (with some additional
        handywork) give final results identical to those of the pslatex backend in
        gnuplot.

        I used gnuplot for about 14 years, so I'm not about to bash it: it's a
        fantastic tool. But there are a number of things it simply can't offer due to
        its design as a standalone program, which matplotlib (being a library/widget
        collection) can do much better. And John Hunter (matplotlib's author) has
        been _extremely_ receptive to my long list of "gnuplot has this and I won't
        switch to matplotlib until you add it" requests. Today, mpl has a number of
        things which have been added by explicitly trying to match either features,
        performance or quality against gnuplot after my repeated pestering to him.
        Given these improvements (many of them quite recent), I finally made the
        switch and I'm extremely happy. Even though rough edges remain (like the tex
        support), I'm confident that the quality of the library and the team behind it
        is such, that they'll be overcome in short order.

        But again, this shouldn't be read as anything against gnuplot: it's a very good
        tool, M. Haggerty's python support makes it a pleasure to use from python, and
        if it does what you need, by all means use it! I just wanted to fill in a bit
        the picture regarding matplotlib, just to be fair to John and his dedicated
        team.

        Regards,

        f

        Comment

        • Torsten Bronger

          #19
          Re: Python Graphing Utilities.

          Hallöchen!

          Fernando Perez <fperez.net@gma il.com> writes:
          [color=blue]
          > [...]
          >
          > Well, it's true that the latex-type (called mathtext) support in
          > matplotlib is not really up to par with true latex (kerning is off
          > in places, mixed text/math doesn't work well, etc). I've been
          > willing to live with it so far, but an alternative option is to
          > use the PS backend and then play psfrag tricks.[/color]

          The problem is that mostly, you'll have a *lot* to substitute.
          [color=blue]
          > I've yet to experiment with it, but it might (with some additional
          > handywork) give final results identical to those of the pslatex
          > backend in gnuplot.[/color]

          What do you mean with this? Do you want to mimic TeX's quality as a
          typesetter, or do you think the goal should be output in real LaTeX
          format (like pslatex does)? The latter would be more useful in my
          opinion, and much easier, too.
          [color=blue]
          > [...] But there are a number of things it simply can't offer due
          > to its design as a standalone program, which matplotlib (being a
          > library/widget collection) can do much better. [...] I finally
          > made the switch and I'm extremely happy.[/color]

          I'm not a fanatic Gnuplot user either. I use it for 11 years, and I
          like exactly two things about it: its simplicity and the pslatex
          backend. I think for my thesis I'll still use it, because its
          integration in a batch process that builds my thesis is much easier
          than to write Python programs.

          But if you have measurement programs in Python (I work in a project
          making this feasible) with on-line plots with mpl, it'd be nice to
          have the possibility to direct them to a file for high-quality
          typesetting as well.

          Tschö,
          Torsten.

          --
          Torsten Bronger, aquisgrana, europa vetus

          Comment

          • Robert Kern

            #20
            Re: Python Graphing Utilities.

            Torsten Bronger wrote:[color=blue]
            > Hallöchen!
            >
            > Fernando Perez <fperez.net@gma il.com> writes:[/color]
            [color=blue][color=green]
            >>I've yet to experiment with it, but it might (with some additional
            >>handywork) give final results identical to those of the pslatex
            >>backend in gnuplot.[/color]
            >
            > What do you mean with this? Do you want to mimic TeX's quality as a
            > typesetter, or do you think the goal should be output in real LaTeX
            > format (like pslatex does)?[/color]

            Both! There is a need for mathematical typesetting in matplotlib without
            a dependency on TeX. Not everyone is making plots destined for inclusion
            in their LaTeX-typeset papers. However, some people, like you and me,
            *are* making such plots and a pslatex-based solution would be a perfect
            fit for that use case.

            --
            Robert Kern
            rkern@ucsd.edu

            "In the fields of hell where the grass grows high
            Are the graves of dreams allowed to die."
            -- Richard Harter

            Comment

            • Fernando Perez

              #21
              Re: Python Graphing Utilities.

              Torsten Bronger wrote:
              [color=blue]
              > Hallöchen!
              >
              > Fernando Perez <fperez.net@gma il.com> writes:
              >[color=green]
              >> [...]
              >>
              >> Well, it's true that the latex-type (called mathtext) support in
              >> matplotlib is not really up to par with true latex (kerning is off
              >> in places, mixed text/math doesn't work well, etc). I've been
              >> willing to live with it so far, but an alternative option is to
              >> use the PS backend and then play psfrag tricks.[/color]
              >
              > The problem is that mostly, you'll have a *lot* to substitute.
              >[color=green]
              >> I've yet to experiment with it, but it might (with some additional
              >> handywork) give final results identical to those of the pslatex
              >> backend in gnuplot.[/color]
              >
              > What do you mean with this? Do you want to mimic TeX's quality as a
              > typesetter, or do you think the goal should be output in real LaTeX
              > format (like pslatex does)? The latter would be more useful in my
              > opinion, and much easier, too.[/color]

              Easier... psfrag tricks can be done right now, while full latex output requires
              writing a new matplotlib backend. It would certainly be a _great_ project,
              but not one I'm about to undertake, while it's reasonable for me to use psfrag
              to fix a few labels here and there to use proper latex. So while I agree with
              you that in the long run a latex backend would be ideal, as a stop-gap
              solution I can live with psfrag.
              [color=blue][color=green]
              >> [...] But there are a number of things it simply can't offer due
              >> to its design as a standalone program, which matplotlib (being a
              >> library/widget collection) can do much better. [...] I finally
              >> made the switch and I'm extremely happy.[/color]
              >
              > I'm not a fanatic Gnuplot user either. I use it for 11 years, and I
              > like exactly two things about it: its simplicity and the pslatex
              > backend. I think for my thesis I'll still use it, because its
              > integration in a batch process that builds my thesis is much easier
              > than to write Python programs.[/color]

              well, unless your batch process _is_ in python :) Mine was, so my
              make_plots.py was a single script, which ironically (for this discussion) was
              all gnuplot.py-based, since this was a few years ago.

              Cheers,

              f

              Comment

              • Petr Mikulik

                #22
                Re: Python Graphing Utilities.

                > A pslatex backend certainly would be interesting. A Gnuplot backend[color=blue]
                > would probably not be feasible. Does it expose its raw drawing operations?[/color]

                There is a patch
                [ 1027032 ] Connect gnuplot_x11 to exterior application window


                which allows to "Connect gnuplot_x11 to exterior application window...".

                If you test it, please write a note there and the patch can go to cvs.

                ---
                PM

                Comment

                • Petr Mikulik

                  #23
                  Re: Python Graphing Utilities.

                  > A pslatex backend certainly would be interesting. A Gnuplot backend[color=blue]
                  > would probably not be feasible. Does it expose its raw drawing operations?[/color]

                  There is a patch
                  [ 1027032 ] Connect gnuplot_x11 to exterior application window


                  which allows to "Connect gnuplot_x11 to exterior application window...".

                  If you test it, please write a note there and the patch can go to cvs.

                  ---
                  PM

                  Comment

                  Working...