MCPcopy Create free account
hub / github.com/KDE/labplot / addHorizontalAxis

Method addHorizontalAxis

src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:1874–1889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1872}
1873
1874void CartesianPlot::addHorizontalAxis() {
1875 DEBUG(Q_FUNC_INFO)
1876 Axis* axis = new Axis(QStringLiteral("x-axis"), Axis::Orientation::Horizontal);
1877 addChild(axis);
1878 axis->setSuppressRetransform(true); // retransformTicks() needs plot
1879 axis->setCoordinateSystemIndex(defaultCoordinateSystemIndex());
1880 if (axis->rangeType() == Axis::RangeType::Auto) {
1881 axis->setUndoAware(false);
1882 // use x range of default plot range
1883 axis->setRange(range(Dimension::X));
1884 axis->setMajorTicksNumber(range(Dimension::X).autoTickCount());
1885 axis->setUndoAware(true);
1886 }
1887 axis->setSuppressRetransform(false);
1888 axis->retransform();
1889}
1890
1891void CartesianPlot::addVerticalAxis() {
1892 Axis* axis = new Axis(QStringLiteral("y-axis"), Axis::Orientation::Vertical);

Callers 1

Calls 7

setUndoAwareMethod · 0.80
setMajorTicksNumberMethod · 0.80
autoTickCountMethod · 0.80
setRangeMethod · 0.45
retransformMethod · 0.45

Tested by 1