Ask Your Question
0

How to put fractions in legends?

asked 2017-01-22 08:31:33 -0600

Romuald_314 gravatar image

Hi,

I've, for example, a plot of a function with a legend. I want to put a fraction or some advanced LaTeX code within the legend block, but I can't. How can I do? Thanks.

goo.gl/ic5lQZ

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-01-22 09:01:31 -0600

mforets gravatar image

updated 2017-01-22 09:04:52 -0600

  • use double backslash, as in legend_label='function equation: $y(x)= \\frac{1}{x}$', or
  • use a "raw string literal" flag, r, as in legend_label=r'function equation: $y(x)= \frac{1}{x}$'.
edit flag offensive delete link more

Comments

Seems to work fine. Thank you, now I'm aware of this tip!

Romuald_314 gravatar imageRomuald_314 ( 2017-01-22 09:35:36 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-01-22 08:31:33 -0600

Seen: 53 times

Last updated: Jan 22