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
Hello
I am new to matplotlib-cpp and looking to plot data also on Seconday y axis , however i could not find any concrete way of doing it. Could anyone guide me through it please
@somdats I don't know if you are stuck with C++, or if you can use python. And how well you know about matlplotlib. Matplotlib-cpp is just a cpp wrapper of the python library matplotlib.
Hello
Thanks for your reply. I am stuck with c++. I could see many solutions for
the same in python script however i am using the matplotlib-cpp wrapper
which currently may not have the implementation. Alternatively i could add
the functionality to the wrapper, however i lack the knowledge in its exact
implementation
Thanks for raising this, and sorry for the long silence. A secondary y axis fits the project: pyplot's twinx() creates a twin axes and makes it current, so a C++ plt::twinx() (and plt::twiny()) wrapper would let later plt::plot calls draw on the secondary axis. A PR that follows the style of the existing no-argument wrappers (look up the function once in the interpreter, throw on failure) and adds a short example to examples/ would be welcome.
🤖 This triage was made by the project's automated governance process. See the README for details.
Activity
JimmyDaSilva commentedon Jun 21, 2018
@somdats I don't know if you are stuck with C++, or if you can use python. And how well you know about matlplotlib. Matplotlib-cpp is just a cpp wrapper of the python library matplotlib.
What you want to do is possible with the python original library:
https://matplotlib.org/gallery/axes_grid1/parasite_simple.html#sphx-glr-gallery-axes-grid1-parasite-simple-py
But I don't know if this C++ wrapper as implemented this feature yet.
Good luck,
Jimmy
somdats commentedon Jun 21, 2018
rennolaj commentedon Dec 3, 2020
I am having this same issue any updates?
Vasichar11 commentedon May 4, 2021
Thanks for the library. Very useful.
Any updates about this issue?
lava commentedon Nov 4, 2026
Thanks for raising this, and sorry for the long silence. A secondary y axis fits the project: pyplot's
twinx()creates a twin axes and makes it current, so a C++plt::twinx()(andplt::twiny()) wrapper would let laterplt::plotcalls draw on the secondary axis. A PR that follows the style of the existing no-argument wrappers (look up the function once in the interpreter, throw on failure) and adds a short example toexamples/would be welcome.🤖 This triage was made by the project's automated governance process. See the README for details.