matplotplusplus
matplotplusplus copied to clipboard
xticklabels doesn't change ticks bar
Bug category
- [ ] bug - compilation error
- [ ] bug - compilation warning
- [x] bug - runtime error
- [ ] bug - runtime warning
- [ ] bug - logic error
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
# The output you got
Platform
- [ ] cross-platform issue - linux
- [x] cross-platform issue - windows
- [ ] cross-platform issue - macos
Environment Details:
- OS: Windows 10
- OS Version: 21H2
- Compiler: MinGW64 GCC
- Compiler version: 11.2.0
Additional context
Maybe we could modify the xticklabels
example until we replicate the bug. It might be ordering of the commands or something.
I've isolated the issue. Labels will be shown if there are 15 or less. Any more and they silently fail
https://github.com/alandefreitas/matplotplusplus/blob/master/source/matplot/axes_objects/bars.cpp#L24 seems like a possible reason for this