Skip to content

Commit

Permalink
Updated the array plot x-axis label (#8826)
Browse files Browse the repository at this point in the history
Fixes #8784
  • Loading branch information
adeas31 committed Apr 12, 2022
1 parent 0cd57e6 commit af7f361
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEditLIB/Plotting/PlotWindowContainer.cpp
Expand Up @@ -347,7 +347,7 @@ void PlotWindowContainer::addArrayPlotWindow(bool maximized)
}
}
pPlotWindow->setTimeUnit(unitComboBox->currentText());
pPlotWindow->setXLabel(QString("index"));
pPlotWindow->setXLabel(QString("array element index"));
pPlotWindow->installEventFilter(this);
QMdiSubWindow *pSubWindow = addSubWindow(pPlotWindow);
PlottingPage *pPlottingPage = OptionsDialog::instance()->getPlottingPage();
Expand Down
5 changes: 3 additions & 2 deletions OMPlot/OMPlot/OMPlotGUI/Plot.cpp
Expand Up @@ -315,13 +315,14 @@ void Plot::replot()
QString timeUnit = mpParentPlotWindow->getTimeUnit();
if (mpParentPlotWindow->getPlotType() == PlotWindow::PLOT
|| mpParentPlotWindow->getPlotType() == PlotWindow::PLOTALL
|| mpParentPlotWindow->getPlotType() == PlotWindow::PLOTINTERACTIVE
|| mpParentPlotWindow->getPlotType() == PlotWindow::PLOTARRAY) {
|| mpParentPlotWindow->getPlotType() == PlotWindow::PLOTINTERACTIVE) {
if (mpXScaleDraw->getUnitPrefix().isEmpty()) {
setAxisTitle(QwtPlot::xBottom, QString("%1 (%2)").arg(mpParentPlotWindow->getXLabel(), timeUnit));
} else {
setAxisTitle(QwtPlot::xBottom, QString("%1 (%2%3)").arg(mpParentPlotWindow->getXLabel(), mpXScaleDraw->getUnitPrefix(), timeUnit));
}
} else if (mpParentPlotWindow->getPlotType() == PlotWindow::PLOTARRAY) {
setAxisTitle(QwtPlot::xBottom, mpParentPlotWindow->getXLabel());
} else {
setAxisTitle(QwtPlot::xBottom, "");
}
Expand Down

0 comments on commit af7f361

Please sign in to comment.