Skip to content

docs: latex required for PDF plotting? #6104

Closed

Description

@dacoex

Plotting to pdf this error occurs:

RuntimeError: LaTeX was not able to process the following string:
b'lp'
Here is the full report generated by LaTeX: 

Is is latex a requirement for backend_pdf?

Nothing mentioned on:
http://matplotlib.org/api/backend_pdf_api.html

Or is it possible to plot into multipage documents without latex?

Activity

  1. WeatherGod commented on Mar 3, 2016

    @WeatherGod
    Member

    It should not be required unless there are settings that turns it on. Do
    you set "usetex=True" anywhere? Perhaps it is in your matplotlibrc file?

    On Thu, Mar 3, 2016 at 10:48 AM, DaCoEx notifications@github.com wrote:

    Plotting to pdf this error occurs:

    RuntimeError: LaTeX was not able to process the following string:
    b'lp'
    Here is the full report generated by LaTeX:

    Is is latex a requirement for backend_pdf?

    Nothing mentioned on:
    http://matplotlib.org/api/backend_pdf_api.html

    Or is it possible to plot into multipage documents without latex?

    —
    Reply to this email directly or view it on GitHub
    #6104.

  2. dacoex commented on Mar 3, 2016

    @dacoex
    ContributorAuthor

    Thanks for the reply.

    I am using WinPython

    in
    WinPython-64bit-3.4.4.1Qt5/$_OUTDIR/python-3.4.4.amd64/Lib/site-packages/matplotlib/mpl-data/matplotlibrc
    there is:
    #text.usetex : False # use latex for all text handling. The following fonts

    Would you see it as good to add this hint somewhere in the docs?
    Also maybe for WinPython?

  3. WeatherGod commented on Mar 3, 2016

    @WeatherGod
    Member

    Hmm, that would indicate that latex isn't supposed to be used. Perhaps the
    full traceback of the original exception and the code to reproduce the
    problem?

    I should point out that WinPython is a bit weird. What they do is package
    various projects from their master branch at arbitrary times. So, while it
    gives you near-bleeding-edge versions of various projects, it may also
    include bugs that never made it out in a release. This can make debugging
    difficult.

    On Thu, Mar 3, 2016 at 1:22 PM, DaCoEx notifications@github.com wrote:

    Thanks for the reply.

    I am using WinPython https://winpython.github.io/

    in

    WinPython-64bit-3.4.4.1Qt5/$_OUTDIR/python-3.4.4.amd64/Lib/site-packages/matplotlib/mpl-data/matplotlibrc

    there is:
    #text.usetex : False # use latex for all text handling. The following fonts

    Would you see it as good to add this hint somewhere in the docs?
    Also maybe for WinPython https://winpython.github.io/?

    —
    Reply to this email directly or view it on GitHub
    #6104 (comment)
    .

  4. dacoex commented on Mar 3, 2016

    @dacoex
    ContributorAuthor

    Hmm, that would indicate that latex isn't supposed to be used. Perhaps the full traceback of the original exception and the code to reproduce the problem?
    No, but about the default value in the rc file, i.e. where to check if someone gets the same error.

    Something like:
    If PDF save does not work, check the rc setting usetex in file...

  5. dacoex commented on Mar 3, 2016

    @dacoex
    ContributorAuthor

    I should point out that WinPython is a bit weird. What they do is package various projects from their master branch at arbitrary times.
    This can make debugging difficult.

    I am using it because run into the dependency circle with anaconda. But yes, will convince IT dept. to reinstall that distro.

  6. WeatherGod commented on Mar 3, 2016

    @WeatherGod
    Member

    I think you are missing the point of what I am saying. First, I am not
    suggesting that WinPython should be reinstalled. Reinstalling it may or may
    not solve your problem. I only point out that it is a bleeding edge distro,
    so it has inherent problems. Second, what you are encountering seems to be
    a bug of some sort. What you are suggesting as a documentation change isn't
    correct. Having usetex=True somewhere and missing latex would cause
    problems for any output format, not just PDFs.

    Have you found a place where usetex was set to True? So far, all I have
    seen is that it is False. If there is no place where usetex is True, then
    there is a bug. It would help immensely to have the full traceback of the
    exception, and example code that produces your problem.

    On Thu, Mar 3, 2016 at 1:44 PM, DaCoEx notifications@github.com wrote:

    I should point out that WinPython is a bit weird. What they do is package
    various projects from their master branch at arbitrary times.
    This can make debugging difficult.
    I am using it because run into the dependency circle with anaconda. But
    yes, will convince IT dept. to reinstall that distro.

    —
    Reply to this email directly or view it on GitHub
    #6104 (comment)
    .

  7. dacoex commented on Mar 3, 2016

    @dacoex
    ContributorAuthor

    I think you are missing the point of what I am saying. First, I am not suggesting that WinPython should >be reinstalled. Reinstalling it may or may not solve your problem.

    Sorry, I was not explicit enough. I meant reinstall Anaconda some time.

    Have you found a place where usetex was set to True?

    Only the line cited above.

    It would help immensely to have the full traceback of the
    exception, and example code that produces your problem.

    I run this code:
    pylab_examples example code: multipage_pdf.py — Matplotlib 1.5.1 ...

  8. WeatherGod commented on Mar 3, 2016

    @WeatherGod
    Member

    The line you point out was commented out. Where was it explicitly set to
    True?

    On Thu, Mar 3, 2016 at 2:01 PM, DaCoEx notifications@github.com wrote:

    I think you are missing the point of what I am saying. First, I am not
    suggesting that WinPython should >be reinstalled. Reinstalling it may or
    may not solve your problem.

    Sorry, I was not explicit enough. I meant reinstall Anaconda some time.

    Have you found a place where usetex was set to True?

    Only the line cited above.

    It would help immensely to have the full traceback of the
    exception, and example code that produces your problem.

    I run this code:
    pylab_examples example code: multipage_pdf.py — Matplotlib 1.5.1 ...
    http://matplotlib.org/examples/pylab_examples/multipage_pdf.html

    —
    Reply to this email directly or view it on GitHub
    #6104 (comment)
    .

  9. WeatherGod commented on Mar 3, 2016

    @WeatherGod
    Member

    Ah-ha! That example explicitly sets usetex to True:

    plt.rc('text', usetex=True)

    On Thu, Mar 3, 2016 at 2:12 PM, Benjamin Root ben.v.root@gmail.com wrote:

    The line you point out was commented out. Where was it explicitly set to
    True?

    On Thu, Mar 3, 2016 at 2:01 PM, DaCoEx notifications@github.com wrote:

    I think you are missing the point of what I am saying. First, I am not
    suggesting that WinPython should >be reinstalled. Reinstalling it may or
    may not solve your problem.

    Sorry, I was not explicit enough. I meant reinstall Anaconda some time.

    Have you found a place where usetex was set to True?

    Only the line cited above.

    It would help immensely to have the full traceback of the
    exception, and example code that produces your problem.

    I run this code:
    pylab_examples example code: multipage_pdf.py — Matplotlib 1.5.1 ...
    http://matplotlib.org/examples/pylab_examples/multipage_pdf.html

    —
    Reply to this email directly or view it on GitHub
    #6104 (comment)
    .

  10. dacoex commented on Mar 3, 2016

    @dacoex
    ContributorAuthor

    OK, you are right. with
    plt.rc('text', usetex=False)

    works nicely.

    In case this happens to others, a hint could be added to:
    http://matplotlib.org/api/backend_pdf_api.html

    Sorry for this confusion and for wasting your time. And thanks for your help.

  11. WeatherGod commented on Mar 3, 2016

    @WeatherGod
    Member

    The hint could be added to the comments for the example. This has nothing
    to do with the pdf backend.

    It wasn't a waste of time. It revealed a bad assumption in some of our
    examples.

    On Thu, Mar 3, 2016 at 3:16 PM, DaCoEx notifications@github.com wrote:

    OK, you are right. with
    plt.rc('text', usetex=False)

    works nicely.

    In case this happens to others, a hint could be added to:
    http://matplotlib.org/api/backend_pdf_api.html

    Sorry for this confusion and for wasting your time. And thanks for your
    help.

    —
    Reply to this email directly or view it on GitHub
    #6104 (comment)
    .

  12. added a commit that references this issue on Mar 4, 2016
  13. dacoex commented on Mar 4, 2016

    @dacoex
    ContributorAuthor

    OK, as consequence of your last comment I change the example.

  14. reopened this on Mar 4, 2016
  15. added this to the milestone on May 22, 2016
  16. QuLogic commented on May 22, 2016

    @QuLogic
    Member

    Fixed by #6119.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions