You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for a great project! I like it very much. However, I'm having troubles plotting the legend for a barchart with multiple groups, and there was no such example in the documentation that would have helped. The legend only shows the first name for all colors (in this case almond). Please see an example code below:
#include <cmath>
#include <matplot/matplot.h>
#include <random> int main() {
std::vector<std::vector<double>> Y = {{2, 2, 2, 2}, {2, 5, 8, 11}, {3, 6, 9, 12}};
auto f = matplot::figure(true);
matplot::bar(Y);
auto lgd = matplot::legend({"almond", "cashew", "hazelnut", "macadamia"});
//show();
f->save("ex.jpg");
return 0;
}
```
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Thanks for a great project! I like it very much. However, I'm having troubles plotting the legend for a barchart with multiple groups, and there was no such example in the documentation that would have helped. The legend only shows the first name for all colors (in this case almond). Please see an example code below:
Beta Was this translation helpful? Give feedback.
All reactions