diff --git a/pyglance/glance/gui_figuremanager.py b/pyglance/glance/gui_figuremanager.py index d45eab8c4131929f699b5c4c87ef97b00572e90a..4c793581b0d1d5b6e7a579bf764b16a228b86ef9 100644 --- a/pyglance/glance/gui_figuremanager.py +++ b/pyglance/glance/gui_figuremanager.py @@ -465,6 +465,13 @@ class GlanceGUIFigures (object) : raise ValueError(NO_DATA_MESSAGE) if dataForm == SIMPLE_2D : + + # double check that our data is a shape we can handle for this type of plot + if len(data_object_to_use.data.shape) != 2 : + raise ValueError("Two dimensional data is required for this plot type. " + "The provided variable data is " + + str(data_object_to_use.data.shape) + " shaped.") + if plotAsRGB : figures.create_raw_image_plot(data_object_to_use.data, "RGB image in File " + file_char_to_use) else :