Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\sageplot and suggest for using a fixed matplotlib render backend #29

Open
amurzeau opened this issue Feb 4, 2019 · 0 comments
Open

Comments

@amurzeau
Copy link

amurzeau commented Feb 4, 2019

Hi,

While analyzing a sagetex autopkgtest issue in Debian when the sagemath package removed its dependency to python-tk, I found that sagetex required python-tk to generate graph with \sageplot.

Actually, I found in matplotlib usage FAQ that matplotlib can use many different backends.
There are rendering backends and interactive backends. Cairo is a rendering backend for example, and TK is an interactive one.
The default used backend is chosen according to different things (configuration file, environment variable, python function call).

Actually, sagetex is using the default backend which is TkAgg and so require python-tk when doing \sageplot.

I don't think sagetex actually require an interactive backend, but just something that can generate a pdf, eps of image file is enough.
So a rendering backend could be enough for sagetex.
Also, sagetex should not depend on user configuration of matplotlib as it seems the case (I've not checked myself but just read matplotlib docs, so it might be different)

So I suggest that sagetex:

  • Depend on a specific rendering backend like cairo that does all required formats (eps, pdf, png and probably formats provided by users)
  • Use matplotlib.use('cairo') (or another backend) so only a known working backend is used and not whatever the user configured.

According to matplotlib usage FAQ, cairo is the only one to support multiple formats including eps, pdf and png.

Here is the Debian bug for reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant