alandefreitas / matplotplusplus

Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
https://alandefreitas.github.io/matplotplusplus/
MIT License
4.11k stars 313 forks source link

xticklabels doesn't change ticks bar #265

Open TheGreatRambler opened 2 years ago

TheGreatRambler commented 2 years ago

Bug category

Describe the bug Using xticklabels doesn't render ticks when using the bar chart as seen in example bar_7.cpp.

Steps to Reproduce

    figure = matplot::figure<matplot::backend::gnuplot> (true);
    figure->ioff ();
    auto ax = figure->current_axes ();
    ax->ytickformat ("%.0f");
    ax->bar (counts);
    ax->xticklabels (names);
    ax->x_grid (true);
    ax->xtickangle (45);
        figure->save (path, "png");

Output

```console # The output you got ```

Platform

Environment Details:

Additional context

alandefreitas commented 2 years ago

Maybe we could modify the xticklabels example until we replicate the bug. It might be ordering of the commands or something.

TheGreatRambler commented 2 years ago

I've isolated the issue. Labels will be shown if there are 15 or less. Any more and they silently fail

TheGreatRambler commented 2 years ago

https://github.com/alandefreitas/matplotplusplus/blob/master/source/matplot/axes_objects/bars.cpp#L24 seems like a possible reason for this