Created
April 19, 2023 17:27
-
-
Save prateekjoshi565/8394fdfc5503ba51083f3e2828e543b4 to your computer and use it in GitHub Desktop.
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
# create a sample data | |
x = [5, 7, 3, 6, 9] | |
y = [7, 3, 5, 8, 2] | |
# create a scatter plot | |
plt.scatter(x, y) | |
plt.title("My Plot") | |
# convert the matplotlib plot to an image | |
buf = io.BytesIO() | |
plt.savefig(buf, format='png') | |
buf.seek(0) | |
plot_img = Image.open(buf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment