Skip to content

Greek fonts using epslatex terminal #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zstreeter opened this issue May 2, 2020 · 3 comments
Closed

Greek fonts using epslatex terminal #19

zstreeter opened this issue May 2, 2020 · 3 comments

Comments

@zstreeter
Copy link

zstreeter commented May 2, 2020

Hi there,

I really love gnuplot and have used it to generate nice plots with latex symbols for publication. This is done with the epslatex terminal that generates two files, out.tex and out.eps. The eps is the bare figure without the latex symbols and the tex document provides the tex symbols.
I am saving the output as "hardcopy=out.tex" just like my gnuplot scipt. The Greek symbols built into gnuplot work (e.g {/Symbol a} for alpha) but I am having a hard time reproducing the latex Greek symbols.

Say I want a phi for the y axis label, then I have ylabel="$\phi$" in python using your plot command but this doesn't reproduce the Greek symbol. I have tried ϕ with two backslashes also, just in case, and this works using just gnuplot.

Any suggestions would be great! Using this workflow would be awesome because I can use python to create actual publication quality figures with your program!

@dkogan
Copy link
Owner

dkogan commented May 2, 2020

Hi. You have two levels of stuff interpreting \ : python and gnuplot. So you can either

  • Use a python "raw" string to make python not interpret \
  • Use an extra set of \

Either of these produce the plot you want:

gp.plot( np.arange(5),
         output   = "tstfigure.tex",
         terminal = "epslatex",
         ylabel = "$\\\\phi$",
         )
gp.plot( np.arange(5),
         output   = "tstfigure.tex",
         terminal = "epslatex",
         ylabel = r"$\\phi$",
         )

@dkogan
Copy link
Owner

dkogan commented May 2, 2020

I'm closing the bug. If you're still having problems, please reopen.

@dkogan dkogan closed this as completed May 2, 2020
@zstreeter
Copy link
Author

Yup that did it! Thank you, I would not have know this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants