tikzplotlib icon indicating copy to clipboard operation
tikzplotlib copied to clipboard

Support for embedding images as base64 with LuaLaTeX

Open csachs opened this issue 4 years ago • 4 comments
trafficstars

Thanks for this awesome package. I was however a bit unhappy by the fact that image data had to be moved around in separate files, always adding some extra hassle when automatically updating figures from Python. Therefore I created the LuaLaTeX package luaimageembed, which allows for base64-encoded image files to be decoded on-the-fly and inserted into a document; and the necessary changes to tikzplotlib within this PR. (I had initially developed this for figures in my PhD thesis in 2017, and ported it to current HEAD).

While this might not be everyone's use case, I think people with similar problems would be happy about this possibility.

PS: Coverage browsing on codecov.io currently seems broken.

csachs avatar Feb 19 '21 16:02 csachs

A nice package, but probably too niche to warrant to the changes. I might change my mind if this gains a larger user base in the future. That said, I really like the package.

PS: Coverage browsing on codecov.io currently seems broken.

Fixed now.

nschloe avatar Feb 19 '21 16:02 nschloe

A nice package, but probably too niche to warrant to the changes. I might change my mind if this gains a larger user base in the future. That said, I really like the package.

Thanks for the response. I understand that this is a niche application. I would then keep this PR open, so that people with a similar problem can find it. The luaimageembed package is part of TeX Live and as such every recent, complete TeX Live installation has it. The embedding as within this PR is a non-default behavior which has to be enabled by passing embed_images=True to save() or get_tikz_code().

PS: Coverage browsing on codecov.io currently seems broken.

Fixed now.

The branch name is correct now, but opening e.g. https://codecov.io/gh/nschloe/tikzplotlib/src/main/tikzplotlib/_save.py still gives me a "GitHub API: Forbidden" error.

csachs avatar Feb 19 '21 16:02 csachs

I would then keep this PR open, so that people with a similar problem can find it.

Sounds good to me.

The branch name is correct now, but opening e.g. https://codecov.io/gh/nschloe/tikzplotlib/src/main/tikzplotlib/_save.py still gives me a "GitHub API: Forbidden" error.

Interesting. No idea why that should be, perhaps an authorization issue at codecov? Works well for me (logged in), but should of course be visible to everyone.

nschloe avatar Feb 19 '21 16:02 nschloe

I would then keep this PR open, so that people with a similar problem can find it.

Sounds good to me.

The branch name is correct now, but opening e.g. https://codecov.io/gh/nschloe/tikzplotlib/src/main/tikzplotlib/_save.py still gives me a "GitHub API: Forbidden" error.

Interesting. No idea why that should be, perhaps an authorization issue at codecov? Works well for me (logged in), but should of course be visible to everyone.

Now it works ... maybe some cache on their side. Thanks for fixing.

csachs avatar Feb 19 '21 16:02 csachs