I am working with google colab and I am trying to save an image to google drive.
# Set the figure size to (5, 5)
with rc_context({'figure.figsize': (5, 5)}):
# Generate the UMAP plot
sc.pl.umap(adata, color='type')
# Save the plot to Google Drive
plt.savefig('/content/drive/umap_plot.png')
However, the file that is generated on the google drive is empty. I also tried to save it asplt.savefig ('/content/umap_plot.png', dpi=300) and as plt.savefig('/content/drive/umap_plot.pdf') but all the files turn out empty. How can I fix this?
Thank you
Have you mounted your Google Drive in the Colab environment? By default, the Google Colab environment is isolated from your Google Drive, so you need to establish a connection between them to read and write files. I have tried to make an example with what you provided but the path may be different than what you have.