Set the right initial legend state

Fix #562