This functionality is partially available in the code already and needs to be finished.
https://invent.kde.org/education/labplot/-/issues/225