fix palette plotting