Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pims/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,11 @@ def plot_to_frame(fig, dpi, **imsave_kwargs):
pims.Frame object containing RGBA values (dtype uint8)
"""
if mpl is None:
raise ImportError('Module matplotlib not found')
raise ImportError("This feature requires matplotlib.")
try:
from PIL import Image
except ImportError:
raise ImportError("This feature requires PIL/Pillow.")
from pims import Frame
buffer = six.BytesIO()
if isinstance(fig, mpl.axes.Axes):
Expand Down Expand Up @@ -419,7 +423,7 @@ def plots_to_frame(figures, width=512, close_fig=False, **imsave_kwargs):
pims.Frame object containing a stack of RGBA values (dtype uint8)
"""
if mpl is None:
raise ImportError('Module matplotlib not found')
raise ImportError("This feature requires matplotlib.")
from pims import Frame
if 'dpi' in imsave_kwargs or 'format' in imsave_kwargs:
raise ValueError('Do not specify dpi or format imsave kwargs.')
Expand Down