Skip to content

Overloading the text() method to accept a keyword arguments map #372

Open

Description

@jm483-dev

I had a need for this in a local project which required loads of custom text elements: made a minimal working example based on the same keyword approach already used e.g. to overload the plot() method in matplotlibcpp.h, this seems to work ok for our purposes:

matplotlibcpp.h addition:
"

...
void text(Numeric x, Numeric y, const std::string& s = "", const std::map<std::string, std::string>& keywords = {})
{ ...

"

example usage:
"

...
plt::text(x+.02125,y_val+.0075,string(pretty_bps),{{"color",EUREX_BLUE},{"fontsize","xx-small"},{"horizontalalignment","right"}});
...

"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions