diff --git a/examples/second_axis/README.md b/examples/second_axis/README.md index 866303c8b8..d8b928236d 100644 --- a/examples/second_axis/README.md +++ b/examples/second_axis/README.md @@ -131,5 +131,6 @@ If we set seondary axes for the x-axis instead of the y-axis, i.e. use // ... ``` we get a plot like this: + ![second_axis_hor](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/second_axis_hor.png) diff --git a/lib/jkqtplotter/jkqtpbaseplotter.cpp b/lib/jkqtplotter/jkqtpbaseplotter.cpp index 80503f4f42..c756abf540 100644 --- a/lib/jkqtplotter/jkqtpbaseplotter.cpp +++ b/lib/jkqtplotter/jkqtpbaseplotter.cpp @@ -3337,14 +3337,20 @@ bool JKQTBasePlotter::hasYAxis(JKQTPCoordinateAxisRef axis) const QSet JKQTBasePlotter::getAvailableXAxisRefs(bool includePrimary) const { - QSet res(secondaryXAxis.keyBegin(),secondaryXAxis.keyEnd()); + QSet res; + for (auto it=secondaryXAxis.begin(); it!=secondaryXAxis.end(); ++it) { + res.insert(it.key()); + } if (includePrimary) res.insert(JKQTPPrimaryAxis); return res; } QSet JKQTBasePlotter::getAvailableYAxisRefs(bool includePrimary) const { - QSet res(secondaryYAxis.keyBegin(),secondaryYAxis.keyEnd()); + QSet res; + for (auto it=secondaryYAxis.begin(); it!=secondaryYAxis.end(); ++it) { + res.insert(it.key()); + } if (includePrimary) res.insert(JKQTPPrimaryAxis); return res; }