diff --git a/common/utils/T/tracer/gui/xy_plot.c b/common/utils/T/tracer/gui/xy_plot.c
index 93b7f682bf8fb5d0bb737a413f342b22e6ad6017..f4d2ff4b01acc082d022b7b14957947d6017c1b7 100644
--- a/common/utils/T/tracer/gui/xy_plot.c
+++ b/common/utils/T/tracer/gui/xy_plot.c
@@ -280,8 +280,13 @@ void xy_plot_get_dimensions(gui *_gui, widget *_this, int *width, int *height)
 
   glock(g);
 
-  *width = this->common.width - this->vrule_width;
-  *height = this->common.height - this->label_height * 2;
+  if (this->common.width == 0 || this->common.height == 0) {
+    *width = this->wanted_width;
+    *height = this->wanted_height;
+  } else {
+    *width = this->common.width - this->vrule_width;
+    *height = this->common.height - this->label_height * 2;
+  }
 
   gunlock(g);
 }