Created
January 23, 2022 17:42
-
-
Save basavyr/763c0a578b2e5ab9cb6b324825a6864f to your computer and use it in GitHub Desktop.
Create a plot label for a graph using `matplotlib` with relative positioning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fig, ax = plt.subplots() | |
x = [] | |
y = [] | |
plt.plot() | |
plt.xlabel() | |
plt.ylabel() | |
ax.legend(loc='best') | |
ax.set_title('') | |
plt.text(0.80, 0.20, '', horizontalalignment='center',verticalalignment='center', transform=ax.transAxes, fontsize=11) | |
plt.savefig('', bbox_inches='tight', dpi=300) | |
fig.tight_layout() | |
plt.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment