alandefreitas / matplotplusplus

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

Fix rticks(), rtickformat(), rticklabels() and rtickangle() being ignored #356

Closed j0hnnybash closed 1 year ago

j0hnnybash commented 1 year ago

The rtick* group of functions previously had no effect unless the the r-axis was manually made visible. The r-axis is invisible by default and instead the major grid is enabled by default (which is much more helpful for polar plots), however this had the undesirable fact that code block that handles the *tick*() functions for arbitrary axis would not be executed.

Another related issue which is also fixed by this change is that both ax->rticklabels({}); and ax->rticks({}); would not hide the tick labels, since hiding tick labels without also hiding the grid requires special handling.

alandefreitas commented 1 year ago

undesirable fact that code block that handles the tick() functions for arbitrary axis would not be executed

I'm not sure I understand this sentence. Would you have an example?

Obs: would you mind using conventional commits and present tense? That allows commits to be properly incorporated into the changelog. Ex: fix: r-ticks are not ignored when ...

In other projects I did include https://github.com/alandefreitas/futures/blob/7442a3cb0e20ce86f280f24e83f1b0bc478b2d04/.github/workflows/build.yml#L131-L133 but matplot++ doesn't have that.

j0hnnybash commented 1 year ago

I'm not sure I understand this sentence. Would you have an example?

Reading my own comment back, I realize it's neither understandable not grammatically correct...

I'll try to come up with some examples (also for the documentation) based on my test code.

alandefreitas commented 1 year ago

Oh... you included complete examples. :) I meant just small inline examples of what you mean in the PR. The new examples are fine, but they require new images for the docs, etc... But I think I get the point now.

alandefreitas commented 1 year ago

Matplotplusplus / MacOSX/10.15/Static/X64/Release (pull_request) Failing after 5m

Uh-oh

j0hnnybash commented 1 year ago

Maybe I should dumb down the example... The OSX build seems to have trouble finding std::cyl_bessel_i, but this should be available in <cmath> with C++17.

Okay, apparently libc++ does not support all C++17 library features yet, "Mathematical Special Function" specifically (see), so I'll have to find a simpler and perhaps also more visually appealing example.

alandefreitas commented 1 year ago

The OSX build seems to have trouble finding std::cyl_bessel_i, but this should be available in with C++17.

Yes. It's common for some STL features never to get really implemented depending on the demand for them. The C++ garbage collector got approved and deprecated without ever being really implemented by anyone.

Maybe I should dumb down the example...

You can remove the examples if you want. We just needed them for the discussion here. If we're keeping these examples, we need to add them to README.md so they can be picked up by the documentation generator.

j0hnnybash commented 1 year ago

Sorry for taking so long.

I've removed the examples, hopefully I'll get around to properly integrate some of them some other time.

alandefreitas commented 1 year ago

Could you please rebase this PR on top of master or develop? The PR is now behind these branches because there has been a release.

j0hnnybash commented 1 year ago

FYI: I rebased onto master.

alandefreitas commented 1 year ago

FYI: I rebased onto master.

Great! Thanks!