Closed MichaelPeibo closed 4 years ago
This is a matplotlib bug, which is caught by scvelo to then save the fig as png
instead of pdf
. The former works, b/c it saves it as an image, while the latter sometimes cannot handle saving thousands of stream lines in vectorized form.
@VolkerBergen thanks for clarification! Any solution toscv.pl.velocity_embedding_stream
so that pdf image can be an option of output?
You could try running %matplotlib inline
right at the start of your notebook (or trying different backends).
Here is my first lines of code:
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:90% !important; }</style>"))
%matplotlib inline
import scvelo as scv
scv.logging.print_version()
import numpy as np
import pandas as pd
import scanpy as sc
import loompy
print(loompy.__version__)
import os
import matplotlib
import matplotlib.pyplot as plt
pd.options.display.max_columns = None
from matplotlib import rcParams
scv.settings.verbosity = 3 # show errors(0), warnings(1), info(2), hints(3)
scv.settings.set_figure_params('scvelo',dpi_save=300) # for beautified visualization
plt.rcParams['pdf.fonttype'] = 'truetype'
Unfortunately, it did not work. The magic thing is, this bug just suddenly happened. I have no idea...
Is there an upstream (i.e. mpl) GitHub issue for this?
the same issue, not resolved.
an alternative is to save in svg format
the same issue, not resolved.
an alternative is to save in svg format
Hi, I forget how I overcome this issue, but my suggestion is to update correlated packages.
In my test, when the fig is too wide, it may output png, rather than pdf. Other samples output pdf on the same machine and same code and packages.
@MichaelPeibo hi, could you remember which packages should be updated? thanks!
@MichaelPeibo hi, could you remember which packages should be updated? thanks!
Hi @Roger-GOAT, I don't really remember which packages I updated. Some of them are dependent on each other, so try to make all main packages up to date. Best of luck!
please refer to issue #85, you may save it as svg and then convert it to pdf.
...
Versions: