Skip to content
Snippets Groups Projects
Commit 7b272b63 authored by Eva Schiffer's avatar Eva Schiffer
Browse files

check if we have non-2D data when making a 2D plot

parent b7dc63cb
No related branches found
No related tags found
No related merge requests found
......@@ -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 :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment