Skip to content
kaustubhmotePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibrePlot

LibrePlot is a LibreOffice extension for creating figures and animations with Python from inside LibreOffice. It is heavily inspired by TexMaths.

libreplot-demo.mp4

Requirements

LibrePlot works with non-sandboxed LibreOffice installations, including AppImages and distribution packages, such as those installed with APT or DNF. It does not work with sandboxed Snap or Flatpak installations.

LibrePlot requires Python and the Python packages used by the submitted code. The default presets use Matplotlib. Animated GIF output also depends on the writer selected in the animation code.

Warning

LibrePlot executes arbitrary Python code with full system access. Use it with extreme caution, and run only code that you trust.

Installation

  • Download the extension file (.oxt) from the releases page and add to Libreoffice as an extension (Ctrl+Alt+E opens the extension manager)
  • Ctrl-G is automatically set as the shortcut and a toolbar item is also added automatically.
  • The first time you run Libreplot, you will need to set the path to your python executable. This can be a conda or a uv or other virtual environment where you have all the necessary requirements installed.

What LibrePlot does

LibrePlot provides a code editor inside LibreOffice with presets for Matplotlib figures and animations. It supports PNG and SVG figures, as well as animated GIF output.

Each inserted graphic stores the Python source and output settings used to create it. When the graphic is selected again, LibrePlot restores those settings and reads the current size and position from the document. The graphic can then be edited and regenerated.

LibrePlot also provides:

  • configurable Python and external-editor paths;
  • editable figure, animation, and custom-code presets;
  • code history for recently generated graphics;
  • control over the output size, position, resolution, and save command;
  • a LibreOffice toolbar in Writer and Impress;
  • the Ctrl+G shortcut on Linux and Windows, or Cmd+G on macOS.

LibrePlot stores its configuration and temporary files in the LibreOffice user directory under Libreplot/. The user director in Linux is usually ~/.config/libreoffice/4/user

See the architecture overview for the extension internals. See build instructions to package an OXT, and test instructions to run the test suite.

The DPI control supplies the DPI variable used by the default save command. Custom save commands can use dpi=DPI or choose their own explicit resolution. Figure sizes and coordinates use hundredths of a millimeter. In Impress, Reset Position places the figure at X=7000 and Y=4000. Writer uses the graphic's anchor instead. Failed runs leave the editor open so you can correct the code.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages