2.2.3 Multiple Plots on One Axis Legend Label Formatting

Hi, This is a great book/study guide. Enjoying it, thanks. G

I’m using Jupyter. I found the label legend in 2.2.3 needs to be changed to:

    current_label = '$\mu = ${:.2f}'.format(m)

Hi there,

What version of python are you running? We updated a lot of labels to use f"" to format strings, which was introduced with python 3.6.

A nice summary of string formatting in python is here: https://dbader.org/blog/python-string-formatting

1 Like

Likewise the next one goes

t = ‘\mu = {:.2f}, \quad \sigma = {:.2f}’.format(m,s)

Hi Guilherme, again the current version works with Python 3.6. The method you propose is the ‘older’ version of string formatting in Python.

1 Like