Strange output with matplotlib usetex

Discussion in 'Python' started by banthur, Mar 9, 2011.

  1. banthur

    banthur

    Joined:
    Mar 9, 2011
    Messages:
    2
    Likes Received:
    0
    I have a somewhat odd problem that gives text rendered using matplotlib's usetex option a 'cartoony' look. I'm not sure exactly how to describe it so I made a picture.

    http://i.imgur.com/CjKlU.png

    The left text was generated using matplotlib and the right side was rendered using MikTeX+TeXnic center. For some reason, the alignment of the characters in matplotlib is slightly uneven. This problem makes text look unprofessional and is not pleasing to the eye. The problem is somewhat mitigated depending on the zoom level you view the text at but it is quite pronounced at typical reading levels.

    I am saving the plot as a .eps file and putting it in my tex document as a figure. The following code reproduces my problem

    Code (Text):

    from pylab import *

    rc('text', usetex=True)
    rc('font', family='serif')
    rc('font', size=14.0)

    yv = sin(arange(0,0.1,10))
    plot(yv)
    title('Aircraft')
    savefig('aircraft.eps')
     
    I'm fairly new to python and tex so any input will be appreciated.

    I have Miktex 2.9, matplotlib 1.0.1, and python 2.6 on Windows 7 x64.
     
    banthur, Mar 9, 2011
    #1
    1. Advertisements

  2. banthur

    banthur

    Joined:
    Mar 9, 2011
    Messages:
    2
    Likes Received:
    0
    I fixed my problem -- I did not realize that using the default settings in matplotlib rasterized text (at a crude resolution). I have sinced added the line

    rc('ps', usedistiller='xpdf')

    and installed the xpdf package. My text looks much, much better now.

    This post can be deleted.
     
    banthur, Mar 9, 2011
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nikk & Jak Anderson

    GZIP output and input strange behaviour

    Nikk & Jak Anderson, Apr 26, 2004, in forum: Java
    Replies:
    2
    Views:
    1,459
    Roedy Green
    Apr 26, 2004
  2. Miroslaw Osys

    very strange gcc output

    Miroslaw Osys, Sep 7, 2003, in forum: C Programming
    Replies:
    4
    Views:
    671
    Emmanuel Delahaye
    Sep 7, 2003
  3. Harvey Twyman
    Replies:
    8
    Views:
    836
    August Derleth
    Oct 25, 2003
  4. Materialised

    Strange output problem

    Materialised, Apr 1, 2004, in forum: C Programming
    Replies:
    15
    Views:
    674
    Dan Pop
    Apr 6, 2004
  5. Dr. Colombes
    Replies:
    3
    Views:
    986
    John Hunter
    Feb 23, 2005
  6. mart_jeeha

    image output in matplotlib

    mart_jeeha, Jun 30, 2006, in forum: Python
    Replies:
    1
    Views:
    1,095
    John Hunter
    Jul 3, 2006
  7. Paul
    Replies:
    1
    Views:
    555
  8. Bill Jackson

    matplotlib, usetex

    Bill Jackson, May 25, 2007, in forum: Python
    Replies:
    4
    Views:
    1,506
    Alexander Schmolck
    May 27, 2007
Loading...