Skip to content

Commit

Permalink
Merge pull request #508 from adtzlr/start-xvfb-notebook-plotting
Browse files Browse the repository at this point in the history
Start virtual framebuffer for notebook plotting of views
  • Loading branch information
adtzlr authored Aug 7, 2023
2 parents 717f195 + 70f1817 commit 66343dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

## [7.6.1] - 2023-08-07

### Changed
- Start a virtual framebuffer in Jupyter notebook plotting of `View.plot(notebook=True)`. Note: Requires `sudo apt-get install xvfb`.

## [7.6.0] - 2023-08-06

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/felupe/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "7.6.0"
__version__ = "7.6.1"
8 changes: 8 additions & 0 deletions src/felupe/tools/_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
along with FElupe. If not, see <http://www.gnu.org/licenses/>.
"""

import os

import numpy as np

from ..math import eigvalsh, tovoigt
Expand Down Expand Up @@ -112,6 +114,12 @@ def plot(
if theme is not None:
pv.set_plot_theme(theme)

# try to start a virtual framebuffer on linux
# requires ``sudo apt-get install xvfb``
if notebook:
if os.name == "posix":
pv.start_xvfb()

if plotter is None:
plotter = pv.Plotter(off_screen=off_screen, notebook=notebook)

Expand Down

0 comments on commit 66343dd

Please sign in to comment.