Ask Your Question
0

How to put fractions in legends?

asked 2017-01-22 15:31:33 +0100

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 16:01:31 +0100

mforets gravatar image

updated 2017-01-22 16:04:52 +0100

  • 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 16:35:36 +0100 )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 15:31:33 +0100

Seen: 363 times

Last updated: Jan 22 '17