Skip to content

Commit 3a85bfc

Browse files
author
Enrique Fernández Perdomo
committed
Merge pull request #12 from clearpathrobotics/matplotlib_background
Use Agg for matplotlib on background
2 parents 238073b + c715938 commit 3a85bfc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bag_tools/scripts/check_drop.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
import numpy
3636
import argparse
3737

38-
import matplotlib.pyplot as plt
38+
# Workaround to avoid issues with X11 rendering when running on background:
39+
import matplotlib as mpl
40+
mpl.use('Agg')
41+
42+
import mpl.pyplot as plt
3943

4044
def check_drop(inbags, plot_format='png'):
4145
# Retrieve msg time, bag time and sequence number for all topics and messages:

bag_tools/scripts/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
import matplotlib as mpl
5151
mpl.use('Agg')
5252

53-
import matplotlib.pyplot as plt
53+
import mpl.pyplot as plt
5454

5555

5656
def get_nested_attribute(msg, nested_attributes):

0 commit comments

Comments
 (0)