python with gnuplot

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jithesh82
    New Member
    • Oct 2007
    • 7

    python with gnuplot

    I want help on using python with gnuplot on windows platform. If somebody could help me I will be very happy
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by jithesh82
    I want help on using python with gnuplot on windows platform. If somebody could help me I will be very happy
    We can help. What have you got so far?

    Comment

    • jithesh82
      New Member
      • Oct 2007
      • 7

      #3
      python with gnuplot

      I would like to know how I can you gnuplot with python on windows platform. I am getting some errors while installing gnuplot.py

      Comment

      • bartonc
        Recognized Expert Expert
        • Sep 2006
        • 6478

        #4
        Originally posted by jithesh82
        I would like to know how I can you gnuplot with python on windows platform. I am getting some errors while installing gnuplot.py
        We can help with that. You must provide specifics regarding your difficulty in order for us to know how to help.

        Thanks.

        Comment

        • Bigbadbradezee
          New Member
          • Oct 2007
          • 7

          #5
          I too am having a trouble getting GnuPlot to work with python. I have vista and have installed Numpy and GnuPlot. I have placed the gnuplot.py in the site packages folder along with GnuPlot and Numpy. When I try and run the gnuplot.py demo it says that there is no module Numeric. I found some help site that said that if Numpy is installed correctly you should be able to import Numeric.

          Is there anything else you need to know?

          Comment

          • bartonc
            Recognized Expert Expert
            • Sep 2006
            • 6478

            #6
            Originally posted by Bigbadbradezee
            I too am having a trouble getting GnuPlot to work with python. I have vista and have installed Numpy and GnuPlot. I have placed the gnuplot.py in the site packages folder along with GnuPlot and Numpy. When I try and run the gnuplot.py demo it says that there is no module Numeric. I found some help site that said that if Numpy is installed correctly you should be able to import Numeric.

            Is there anything else you need to know?
            A test of your NumPy installation would be:[CODE=python]
            >>> from numpy import oldnumeric[/CODE]
            I know that I have Numeric and NumPy both installed on my system so that I never run into this problem. You can get Numeric on SourceForge.
            SciPy has also proven to be invaluable.

            I should also ask which OS you are on as there could be installation issues that we can look at in that light.
            Last edited by bartonc; Oct 22 '07, 02:49 AM.

            Comment

            • Bigbadbradezee
              New Member
              • Oct 2007
              • 7

              #7
              Originally posted by bartonc
              A test of your NumPy installation would be:[CODE=python]
              >>> from numpy import oldnumeric[/CODE]
              This test worked.

              Originally posted by bartonc
              I know that I have Numeric and NumPy both installed on my system so that I never run into this problem. You can get Numeric on SourceForge.
              SciPy has also proven to be invaluable.

              I should also ask which OS you are on as there could be installation issues that we can look at in that light.
              I have Vista and Python 2.5 installed, which when I tried to install Numeric it says it needs 2.4 to work and I couldn't find a version that worked with 2.5

              Comment

              • bartonc
                Recognized Expert Expert
                • Sep 2006
                • 6478

                #8
                Originally posted by Bigbadbradezee
                I have Vista and Python 2.5 installed, which when I tried to install Numeric it says it needs 2.4 to work and I couldn't find a version that worked with 2.5
                Yep. That's why I asked.

                Current officially released version is gnuplot 4.2.2
                (released on September 1, 2007).
                But # Gnuplot.py version 1.7 released 2003-10-19

                My connection's the pits at the moment. I'll check out that for you. You may also want to check out matplotlib.

                Comment

                • Bigbadbradezee
                  New Member
                  • Oct 2007
                  • 7

                  #9
                  Originally posted by bartonc
                  Yep. That's why I asked.

                  Current officially released version is gnuplot 4.2.2
                  (released on September 1, 2007).
                  But # Gnuplot.py version 1.7 released 2003-10-19

                  My connection's the pits at the moment. I'll check out that for you. You may also want to check out matplotlib.
                  yeah i have those two versions.
                  also, i tried using that code they have with numpy to update from numeric but that didn't seem to work, but I doubt i was using it correctly.

                  Comment

                  • bartonc
                    Recognized Expert Expert
                    • Sep 2006
                    • 6478

                    #10
                    Originally posted by bartonc
                    A test of your NumPy installation would be:[CODE=python]
                    >>> from numpy import oldnumeric[/CODE]
                    I know that I have Numeric and NumPy both installed on my system so that I never run into this problem. You can get Numeric on SourceForge.
                    SciPy has also proven to be invaluable.

                    I should also ask which OS you are on as there could be installation issues that we can look at in that light.
                    I haven't had a chance to try this yet, but wanted to see some progress. Have you tried modifying the source code of the gnuplot library thusly:[CODE=python]
                    >>> from numpy import oldnumeric as Numeric[/CODE]Numeric may be imported in more that one place it the package, so I may need to come up with a better fix (like creating a new init.py for the package).

                    Comment

                    • bartonc
                      Recognized Expert Expert
                      • Sep 2006
                      • 6478

                      #11
                      Originally posted by bartonc
                      I haven't had a chance to try this yet, but wanted to see some progress. Have you tried modifying the source code of the gnuplot library thusly:[CODE=python]
                      >>> from numpy import oldnumeric as Numeric[/CODE]Numeric may be imported in more that one place it the package, so I may need to come up with a better fix (like creating a new init.py for the package).
                      I just found some interesting links for you:Numericix for starters.

                      Comment

                      • Bigbadbradezee
                        New Member
                        • Oct 2007
                        • 7

                        #12
                        Originally posted by bartonc
                        I just found some interesting links for you:Numericix for starters.

                        I looked at that site but was confused as to what I am supposed to be looking for.

                        also I tried the above fix and this message then popped up and confused me even more.

                        >>> C:\Program Files\Python25\ Lib\site-packages\gnuplo t-py-1.7\demo.py:50: Warning: 'with' will become a reserved keyword in Python 2.6
                        Traceback (most recent call last):
                        File "C:\Program Files\Python25\ Lib\site-packages\gnuplo t-py-1.7\demo.py", line 22, in <module>
                        import Gnuplot, Gnuplot.funcuti ls
                        ImportError: No module named Gnuplot
                        >>>

                        Comment

                        • bartonc
                          Recognized Expert Expert
                          • Sep 2006
                          • 6478

                          #13
                          Originally posted by Bigbadbradezee
                          I looked at that site but was confused as to what I am supposed to be looking for.

                          also I tried the above fix and this message then popped up and confused me even more.

                          >>> C:\Program Files\Python25\ Lib\site-packages\gnuplo t-py-1.7\demo.py:50: Warning: 'with' will become a reserved keyword in Python 2.6
                          Traceback (most recent call last):
                          File "C:\Program Files\Python25\ Lib\site-packages\gnuplo t-py-1.7\demo.py", line 22, in <module>
                          import Gnuplot, Gnuplot.funcuti ls
                          ImportError: No module named Gnuplot
                          >>>
                          The best solution that I have at the moment is that you install Python 2.4.4 (I have both that and 2.5 installed on system and use 2.4 for just this type of scenario).

                          Comment

                          • Bigbadbradezee
                            New Member
                            • Oct 2007
                            • 7

                            #14
                            alright, well thank you for your help

                            Comment

                            • bartonc
                              Recognized Expert Expert
                              • Sep 2006
                              • 6478

                              #15
                              Originally posted by Bigbadbradezee
                              alright, well thank you for your help
                              I think that I've found the answer to this.
                              In modules that depend on numeric, change the line[CODE=python]import numeric[/CODE]to[CODE=python]from numpy.core import numeric[/CODE]
                              Last edited by bartonc; Nov 12 '07, 05:25 PM.

                              Comment

                              Working...