Skip to main content

All Questions

1 vote
0 answers
209 views

Both latex and parameter values in python strings

I want to add a title to my plots (in matplotlib) which would display both parameters and their values, something like f"$\alpha$ = {present value of alpha}, $\beta$ = {present value of beta}&...
Vadim's user avatar
  • 131
3 votes
1 answer
876 views

f-string in yaxis.set_major_formatter

I have the following code: import pandas as pd from pandas import DataFrame as df import matplotlib from pandas_datareader import data as web import matplotlib.pyplot as plt import datetime import ...
Slartibartfast's user avatar
0 votes
2 answers
2k views

What does the f do in plt.ylabel(f'g(x)')?

Firstly, import matplotlib.pyplot as plt import matplotlib In an elementary example on how to plot with matplotlib in our lecture I encountered the following line plt.ylabel(f'g(x)') What I have ...
ViktorStein's user avatar
29 votes
1 answer
30k views

How to display LaTeX f-strings in matplotlib [duplicate]

In Python 3.6, there is the new f-string to include variables in strings which is great, but how do you correctly apply these strings to get super or subscripts printed for matplotlib? (to actually ...
will.mendil's user avatar
  • 1,055