Strange output with matplotlib usetex

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

  1. banthur

    banthur

    Joined:
    Mar 9, 2011
    Messages:
    2
    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:
    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. Advertising

  2. banthur

    banthur

    Joined:
    Mar 9, 2011
    Messages:
    2
    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. Advertising

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. Harvey Twyman
    Replies:
    8
    Views:
    586
    August Derleth
    Oct 25, 2003
  2. Dr. Colombes
    Replies:
    3
    Views:
    692
    John Hunter
    Feb 23, 2005
  3. mart_jeeha

    image output in matplotlib

    mart_jeeha, Jun 30, 2006, in forum: Python
    Replies:
    1
    Views:
    1,012
    John Hunter
    Jul 3, 2006
  4. Paul
    Replies:
    1
    Views:
    446
  5. Bill Jackson

    matplotlib, usetex

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

Share This Page