diff --git a/lib/Biodiverse/GUI/Tabs/Labels.pm b/lib/Biodiverse/GUI/Tabs/Labels.pm
index 0500ad196..9b63a3665 100644
--- a/lib/Biodiverse/GUI/Tabs/Labels.pm
+++ b/lib/Biodiverse/GUI/Tabs/Labels.pm
@@ -799,7 +799,7 @@ sub on_selected_phylogeny_changed {
$self->set_phylogeny_options_sensitive(1);
}
else {
- $self->{dendrogram}->set_cluster(undef, 'length');
+ $self->{dendrogram}->set_cluster(undef, $self->{plot_mode} //= 'length');
$self->set_phylogeny_options_sensitive(0);
my $str = 'No selected tree';
$self->get_xmlpage_object('label_VL_tree')->set_markup($str);
diff --git a/lib/Biodiverse/GUI/Tabs/Spatial.pm b/lib/Biodiverse/GUI/Tabs/Spatial.pm
index 84a92cd49..51da0a181 100644
--- a/lib/Biodiverse/GUI/Tabs/Spatial.pm
+++ b/lib/Biodiverse/GUI/Tabs/Spatial.pm
@@ -1126,11 +1126,11 @@ sub on_selected_phylogeny_changed {
$self->{dendrogram}->clear;
}
if ($phylogeny) {
- $self->{dendrogram}->set_cluster($phylogeny, 'length'); # now storing tree objects directly
+ $self->{dendrogram}->set_cluster($phylogeny, $self->{plot_mode} //= 'length'); # now storing tree objects directly
$self->set_phylogeny_options_sensitive(1);
}
else {
- $self->{dendrogram}->set_cluster(undef, 'length');
+ $self->{dendrogram}->set_cluster(undef, $self->{plot_mode} //= 'length');
$self->set_phylogeny_options_sensitive(0);
my $str = 'No selected tree';
$self->get_xmlpage_object('spatial_label_VL_tree')->set_markup($str);