Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template to handle strings on x axis w/ legend #254

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

impressostudios
Copy link

bool named_plot(const std::string& name, const std::vectorstd::string& x, const std::vector& y, const std::string& format = "") { .. }

added template to be able to have named legend plotting: ex: time(x) vs signal(y) with legend.
Prior to this change, the current library implements simple plots with no legends and with this change the above should be possible.

bool named_plot(const std::string& name, const std::vector<std::string>& x, const std::vector<Numeric>& y, const std::string& format = "") { .. }

added template to be able to have named legend plotting: ex: time(x) vs signal(y) with legend. 
Prior to this change, the current library implements simple plots with no legends and with this change the above should be possible.
@lava
Copy link
Owner

lava commented Apr 2, 2021

Thanks for contributing!

I'm a bit confused if/why this works, it's not mentioned on the matplotlib docs that x can be a vector of strings: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html

Would you mind adding an example that uses this function, so I can check out that this works as it should?

@impressostudios
Copy link
Author

impressostudios commented Apr 3, 2021 via email

@impressostudios
Copy link
Author

@lava this is open for more than 2 years. if my response answers your question, can you please merge my pull request ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants