Browse code

if there is only one at, ncol and nrow all set to 1

Zuguang Gu authored on 31/03/2017 11:38:09
Showing 1 changed files

... ...
@@ -152,6 +152,10 @@ discrete_legend_body = function(at, labels = at, nrow = NULL, ncol = 1,
152 152
 	} else {
153 153
 		ncol = ceiling(n_labels / nrow)
154 154
 	}
155
+	if(length(at) == 1) {
156
+		nrow = 1
157
+		ncol = 1
158
+	}
155 159
 
156 160
 	labels_padding_left = unit(1, "mm")
157 161