I couldn't find the right function to add a footnote in my plot.
The footnote I want to have is something like an explanation of one item in the legend, but it is too long to put in the legend box. So, I'd like to add a ref number, e.g. [1], to the legend item, and add the footnote in the bottom of the plot, under the x-axis.
Which function should I use? Thanks!
[^@#$%]: A footnote on the label: "@#$%". A footnote label must start with a caret ^ and may contain any inline text (including spaces) between a set of square brackets [] . Only the first caret has any special meaning. A footnote content must start with the label followed by a colon and at least one space.
Add text under plot matplotlib We use the figtext() method to add text in the figure area and we set the horizontal and vertical alignment at the center. In this above example, we add the text under the plot by using the fig. text() method and we pass the argument x = 0.5 and y=0.01.
To add caption to the figure, use text() method. Adjust the padding between and around the subplots. To display the figure, use show() method.
To fill the area under the curve, put x and y with ste="pre", using fill_between() method. Plot (x, y1) and (x, y2) lines using plot() method with drawstyle="steps" method. To display the figure, use show() method.
One way would be just use plt.text(x,y,'text')
You would be just use:
plt.figtext(0.5, 0.01, "one text and next text", ha="center", fontsize=18, bbox={"facecolor":"orange", "alpha":0.5, "pad":5})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With