Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Diverging PNG and PDF graphs on Linux machines

    SOLVED!
    So far I've tried with ubuntu 20.04 and Manjaro (updated on April the 3rd). The issue seems to affect only text, such as legends and axis labels.

    Code:
    sysuse uslifeexp, clear
    line le_male le_female year
    graph export /tmp/test.pdf
    graph export /tmp/test.png
    The above code produces the following results. (PDF on the left, and PNG on the right).
    Click image for larger version

Name:	Screenshot from 2020-04-04 17-29-03.png
Views:	1
Size:	86.8 KB
ID:	1544742



    As you can see, the legend on the PDF version is weird. It is not a matter of size, because a vsmall legend will reduce it's overall size, but it will also be out of bounds.

    Anyone facing a similar issue?
    I believe it might be a problem with a missing font. but I don't which font Stata uses for plotting or how to change it.

    possibly (un)related and sill unsolved: https://www.statalist.org/forums/for...aro-arch-based


    Last edited by Marc Rain; 04 Apr 2020, 12:10.

  • #2
    Okay... a little more searching and I found the issue... it is indeed the font.

    Code:
    graph set window fontface "Arial"
    The above command does work around the issue... or installing Microsoft fonts should also fix. Example for ubuntu:

    Code:
    sudo add-apt-repository multiverse
    sudo apt update && sudo apt install ttf-mscorefonts-installer
    Thats it.

    Comment

    Working...
    X