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

User Defined Tick Labels #51

Closed
epezent opened this issue Jun 3, 2020 · 2 comments
Closed

User Defined Tick Labels #51

epezent opened this issue Jun 3, 2020 · 2 comments

Comments

@epezent
Copy link
Owner

epezent commented Jun 3, 2020

Both PlotBars and PlotHeatmap could benefit from the ability to add custom tick labels at specific locations (actually, this is a useful feature in general). The API function(s) for this would likely have to precedeBeginPlot due to the order in which plot-bounding boxes are calculated. Something like this might work:

SetNextPlotTickLabelsX(const char** labels, float* values, int n);
SetNextPlotTickLabelsY(const char** labels, float* values, int n, int y_axis = 0);

We would have to consider whether this should add to or override the default tick labels. Thoughts?

Looping in folks...
@ozlb @sergeyn @jpieper

@epezent
Copy link
Owner Author

epezent commented Jun 3, 2020

I went ahead and added this.
#48 (comment)

// Set the X axis ticks and optionally the labels for the next plot.
void SetNextPlotTicksX(const double* values, int n_ticks, const char** labels = NULL, bool show_default = false);
void SetNextPlotTicksX(double x_min, double x_max, int n_ticks, const char** labels = NULL, bool show_default = false);
// Set the Y axis ticks and optionally the labels for the next plot.
void SetNextPlotTicksY(const double* values, int n_ticks, const char** labels = NULL, bool show_default = false, int y_axis = 0);
void SetNextPlotTicksY(double y_min, double y_max, int n_ticks, const char** labels = NULL, bool show_default = false, int y_axis = 0);

Feel free to share feedback. Closing the issue for now.

@epezent epezent closed this as completed Jun 3, 2020
@ozlb
Copy link
Contributor

ozlb commented Jun 4, 2020

Neat and great as per your standard, what to say... I like it.

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

No branches or pull requests

2 participants