Skip to content

X Tick Angle

1
xtickangle(ang);

example_xtickangle_1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#include <matplot/matplot.h>

int main() {
    using namespace matplot;

    auto x = linspace(0, 10000, 21);
    auto y = transform(x, [](double x) { return pow(x, 2); });
    stem(x, y);
    xtickangle(45);

    show();
    return 0;
}

More examples

example_xtickangle_2

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <matplot/matplot.h>

int main() {
    using namespace matplot;

    tiledlayout(2, 1);

    auto ax1 = nexttile();
    plot(ax1, rand(6, 6, 0, 1));

    auto ax2 = nexttile();
    plot(ax2, rand(6, 6, 0, 1));
    xtickangle(ax2, 45);

    show();
    return 0;
}

example_xtickangle_3

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <matplot/matplot.h>

int main() {
    using namespace matplot;

    auto x = linspace(0, 10000, 21);
    auto y = transform(x, [](double x) { return pow(x, 2); });
    stem(x, y);

    std::cout << "xtickangle(): " << xtickangle() << std::endl;

    show();
    return 0;
}