Results 1 to 7 of 7

Thread: matplotlib fails to show plots after latest update from the Sciencerepolistory

  1. #1
    Eric NNTP User

    Default matplotlib fails to show plots after latest update from the Sciencerepolistory

    I am not sure if this is the right place to ask and I apologize if it is
    not but if there is anybody using ipython with matplotlib from the
    science repository can you check and see if you get any plot windows?
    There was an update I applied with a build date of 2 January 2014 that
    included both matplotlib and scikit-learn both from the Science
    repository and now if I try to get any plot nothing shows with no errors
    given. I have been using this software successfully from the Science
    repository before the update.

    example:

    code
    --------------------------------------------
    >ipthyon --pylab


    Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC]
    Type "copyright", "credits" or "license" for more information.

    IPython 0.13.1 -- An enhanced Interactive Python.
    ? -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help -> Python's own help system.
    object? -> Details about 'object', use 'object??' for extra details.

    Welcome to pylab, a matplotlib-based Python environment [backend: Agg].
    For more information, type 'help(pylab)'.

    In [1]: x = linspace(0,2*pi,50)

    In [2: plot(x,sin(x))
    Out[2]: [<matplotlib.lines.Line2D at 0x2d9ea10>]
    ----------------------------------------------------

    A matplotlib plot should show up plotting x vs sin(x) but nothing shows.

    I get the same results in two different computer using openSUSE 12.3 and
    openSUSE 13.1.

    I don't know if there is a bug in the program if I am doing something wrong.

    Any help would be appreciated.

    Eric

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: matplotlib fails to show plots after latest update from the Sciencerepolistory

    Am 05.01.2014 22:12, schrieb Eric:
    > [backend: Agg]


    That will never show any window, your matplotlib is configured to use
    agg, which is no gui version of output.
    Install a gui backend like python-matplotlib-qt4, python-matplotlib-tk
    and try again.

    --
    PC: oS 13.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.11 | GTX 650 Ti
    ThinkPad E320: oS 13.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.11 | HD 3000
    HTPC: oS 13.1 x86_64 | Celeron@1.8GHz | 2GB | Gnome 3.10 | HD 2500

  3. #3
    Eric NNTP User

    Default Re: matplotlib fails to show plots after latest update from the Sciencerepolistory

    I changed the version of mathplotlib back to the openSUSE-OSS version
    instead of the one in the Science repository and all seems to be working
    now.

    Hope this helps anyone who had the same problem.

    Eric



    On 01/05/2014 02:12 PM, Eric wrote:
    > I am not sure if this is the right place to ask and I apologize if it is
    > not but if there is anybody using ipython with matplotlib from the
    > science repository can you check and see if you get any plot windows?
    > There was an update I applied with a build date of 2 January 2014 that
    > included both matplotlib and scikit-learn both from the Science
    > repository and now if I try to get any plot nothing shows with no errors
    > given. I have been using this software successfully from the Science
    > repository before the update.
    >
    > example:
    >
    > code
    > --------------------------------------------
    > >ipthyon --pylab

    >
    > Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC]
    > Type "copyright", "credits" or "license" for more information.
    >
    > IPython 0.13.1 -- An enhanced Interactive Python.
    > ? -> Introduction and overview of IPython's features.
    > %quickref -> Quick reference.
    > help -> Python's own help system.
    > object? -> Details about 'object', use 'object??' for extra details.
    >
    > Welcome to pylab, a matplotlib-based Python environment [backend: Agg].
    > For more information, type 'help(pylab)'.
    >
    > In [1]: x = linspace(0,2*pi,50)
    >
    > In [2: plot(x,sin(x))
    > Out[2]: [<matplotlib.lines.Line2D at 0x2d9ea10>]
    > ----------------------------------------------------
    >
    > A matplotlib plot should show up plotting x vs sin(x) but nothing shows.
    >
    > I get the same results in two different computer using openSUSE 12.3 and
    > openSUSE 13.1.
    >
    > I don't know if there is a bug in the program if I am doing something
    > wrong.
    >
    > Any help would be appreciated.
    >
    > Eric



  4. #4
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: matplotlib fails to show plots after latest update from the Sciencerepolistory

    but you know that it is absolutely trivial to select which backend you
    want to use in matplotlib?
    http://matplotlib.org/faq/usage_faq....t-is-a-backend
    Anyway you solved your problem so I am glad to hear it works now for you.

    --
    PC: oS 13.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.11 | GTX 650 Ti
    ThinkPad E320: oS 13.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.11 | HD 3000
    HTPC: oS 13.1 x86_64 | Celeron@1.8GHz | 2GB | Gnome 3.10 | HD 2500

  5. #5
    Eric NNTP User

    Default Re: matplotlib fails to show plots after latest update from the Sciencerepolistory

    On 01/05/2014 02:26 PM, Martin Helm wrote:
    > Am 05.01.2014 22:12, schrieb Eric:
    >> [backend: Agg]

    >
    > That will never show any window, your matplotlib is configured to use
    > agg, which is no gui version of output.
    > Install a gui backend like python-matplotlib-qt4, python-matplotlib-tk
    > and try again.
    >


    Martin,

    I have the gui backends installed as it was working before the update.
    I tried changing the configuration in matplotlibrc to

    backend.qt4 : PyQt4

    and also issuing the command
    -----------------------------------------

    matplotlib.rcParams['backend'] = 'Qt4Agg'

    ------------------------------------------
    in an ipython shell with the same results. Not sure if that was the
    correct way but found it while searching google.

    I am guessing that I had originally had matplotlib from the OSS
    repository and the last update changed it to the Science repository and
    it did not play well with the setup I have. I am using numpy, scipy,
    sympy and scikit-learn all from the Science repository. Everything
    seems to be working now after changing matplotlib to the OSS repository.

    Thank you,

    Eric

  6. #6
    Eric NNTP User

    Default Re: matplotlib fails to show plots after latest update from the Sciencerepolistory

    On 01/05/2014 03:35 PM, Martin Helm wrote:
    > but you know that it is absolutely trivial to select which backend you
    > want to use in matplotlib?
    > http://matplotlib.org/faq/usage_faq....t-is-a-backend
    > Anyway you solved your problem so I am glad to hear it works now for you.
    >


    Thank you for the link. If I have anymore trouble I will try changing
    the backend with the

    ---------------------------

    matplotlib.use('TkAgg')

    --------------------------


    in the ipython shell.

    Eric

  7. #7
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: matplotlib fails to show plots after latest update from the Sciencerepolistory

    Am 06.01.2014 00:23, schrieb Eric:
    > Thank you for the link. If I have anymore trouble I will try changing
    > the backend with the
    >
    > matplotlib.use('TkAgg')
    >
    > in the ipython shell.


    You can also specify the backend in your call of ipython, myself I am
    using "ipython --pylab=qt" for Tk this would be "--pylab=tk".

    --
    PC: oS 13.1 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.11 | GTX 650 Ti
    ThinkPad E320: oS 13.1 x86_64 | i3@2.30GHz | 8GB | KDE 4.11 | HD 3000
    HTPC: oS 13.1 x86_64 | Celeron@1.8GHz | 2GB | Gnome 3.10 | HD 2500

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •