[Matplotlib-users] em-dash not correctly displayed in saved pdf when using tex

Thomas Caswell tcaswell at gmail.com
Wed Jan 6 09:06:45 EST 2016


What is the default encoding on your system?  I wonder if in `draw_tex` or
`dvi_read` we are transcoding the text?

Tom

On Wed, Jan 6, 2016 at 8:56 AM Michael Droettboom <mdroettboom at continuum.io>
wrote:

> I can't reproduce with matplotlib master, suggesting this bug has already
> been fixed.
>
> Mike
>
> On Mon, Dec 28, 2015 at 4:26 AM, Chao-Chin Yang <chaochinyang at icloud.com>
> wrote:
>
>> Hi, I am having issues with producing an em-dash in pdf when using tex.
>> A sample script is as below:
>>
>> #!/usr/bin/env python3
>> import matplotlib.pyplot as plt
>> import math
>> import numpy as np
>>
>> x = np.linspace(0, 2 * math.pi)
>> y = np.cos(x)
>>
>> plt.plot(x, y)
>> plt.suptitle(r"abc --- def")
>> plt.savefig("test.pdf")
>> plt.show()
>>
>> I have customized rc parameters:
>>
>> backend = “TkAgg”
>> font.family = “serif”
>> text.usetex = True
>> image.cmap = “CMRmap"
>>
>> The plot rendered on screen looks fine.  However, there are some weird
>> characters showing up right before the em-dash in the saved pdf, as
>> attached here.
>>
>>
>>
>> I am using Linux Mint 17.3, and uname -a gives
>>
>> Linux Eridanus 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22
>> 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
>>
>> I am using python 3.4.3 + matplotlib 1.3.1, the latter of which is kind
>> of old, but still remains the latest in the Ubuntu LTS repository.  On the
>> other had, I have installed the texlive-full package, which should include
>> all the tex related packages.  My dvipng is 1.14, and my ghostscript is
>> 9.10.  I have also tried different backends like Agg or PDF, but it makes
>> no difference.
>>
>> I have tried googling around for similar issues, but had no luck.
>>
>> It would be very much appreciated If anyone had some idea how this comes
>> about.
>>
>> Sincerely,
>> Chao-Chin
>>
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users at python.org
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>>
>>
>
>
> --
> Michael Droettboom
> Continuum Analytics
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160106/69a78f74/attachment.html>


More information about the Matplotlib-users mailing list