Skip to content

Font size grainular control #20

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 3, 2020 · 6 comments
Closed

Font size grainular control #20

zstreeter opened this issue May 3, 2020 · 6 comments

Comments

@zstreeter
Copy link

Hi,

I want to control each individual label, legend, etc font sizes just like in gnuplot. I changed the font size for the whole picture in the terminal command like your demo but this creates large white-spaces and defeated the purpose for creating the larger font. (Please see attached photo.) I am using epslatex terminal for research papers FYI.

The syntax in gnuplot is xlabel = "x axis" font ",20" and I am not sure how to did that with your interface.

Thank you!

graph.pdf

@dkogan
Copy link
Owner

dkogan commented May 3, 2020 via email

@zstreeter
Copy link
Author

zstreeter commented May 3, 2020

The pertinent python command that produced the graph.pdf I attached before is

gp.plot(x,y, _with='lines', xlabel='R', ylabel=r'$\phi$', terminal='epslatex font ",20"',
hardcopy='test.tex')

and I have attached the gnuplot script. But this global increase in font also created a lot of white-space between the symbols and the figure in graph.pdf (even made a large white-space between the x-axis numbers and the figure), which doesn't look nice. In gnuplot, you can set the font size of individual strings ( set xlabel "Matrix Size" font ",20") like in my script. I was trying to do this because I thought this would give me larger fonts without the added large white-space.

So the main thing I would like is larger fonts but with appropriate amount of white-space needed for the larger character. In gnuplot, creating larger fonts for the ylabel, for example, doesn't also push the label far to the left with too much white-space like the $\phi$ symbol in graph.pdf attached previously. Does that make sense?

gnuplot_script.txt

@dkogan
Copy link
Owner

dkogan commented May 3, 2020 via email

@zstreeter
Copy link
Author

zstreeter commented May 3, 2020

Thank you for your help. I ran some tests and found the problem is within the Latex renderer for the fonts. Setting your interface aside, I cannot create larger fonts after the Latex engine reproduces the fonts so I think it has something to do with the epslatex terminal creating a tex document from the gnuplot script and not recognizing the font command. At any rate, I just looked at making a normal Gnuplot plot with your interface but without the post Latex rendered fonts and your _set command produced the expected result.

What is the syntax for more than one string? I have tried a few but keep getting syntax errors. Something like
plot(...,
_set='xlabel "Matrix Size" font ",20" ylabel "Percentage" font",30" title "Title" font ",40" ')
or how would you wright this?


Possible Solution

http://www.gnuplotting.org/tag/epslatex/

Please go to this site and look at the section titled "Label size in epslatex terminal". This looks like how you can control the font sizes in this terminal. Would your interface be able to reproduce these commands?

Thank you!

@dkogan
Copy link
Owner

dkogan commented May 3, 2020 via email

@zstreeter
Copy link
Author

Okay great, thank you for your help!

It's definitely easier to just use the font from Gnuplot but it would be nice to have the more aesthetically pleasing Latex fonts. I at least know how to approach what I want and the problems are not with your interface so thank you again!

@dkogan dkogan closed this as completed May 3, 2020
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