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

Percentage tick labels #336

Closed
sfiruch opened this issue Apr 6, 2020 · 4 comments
Closed

Percentage tick labels #336

sfiruch opened this issue Apr 6, 2020 · 4 comments

Comments

@sfiruch
Copy link

sfiruch commented Apr 6, 2020

What can we do to make ScottPlot better?
I'm trying to do a Scatter plott with percentages on both axes. It'd be great it ScottPlot supported conversion from "0.3184" to "31.8%" with a simple flag.

var plot = new ScottPlot.Plot();
...
plot.Ticks(percentages: true);

A more flexible, alternative solution of #297 might help in this case as well.

@swharden
Copy link
Member

swharden commented Apr 6, 2020

I'm trying to do a Scatter plott with percentages on both axes. It'd be great it ScottPlot supported conversion from "0.3184" to "31.8%" with a simple flag.

Hi @deiruch thanks for the suggestion! I think this is true, and a flexible option that also supported currency would be nice. I'll think about the best way to implement this and make an update soon!

@swharden
Copy link
Member

swharden commented Apr 6, 2020

Hey @deiruch, thanks again for the suggestion! I think this solution is an improvement across the board.

Users can now define a standard numeric string format for X and Y tick labels. This lets users display ticks using scientific notation, percentage, currency, etc. and also control the precision of the numbers displayed in tick labels.

plt.Ticks(numericFormatStringX: "E2", numericFormatStringY: "P1");

image

What do you think?

@sfiruch
Copy link
Author

sfiruch commented Apr 7, 2020

Fantastic! Exactly what I was looking for!!!

Thank you very much! ScottPlot is much appreciated!

swharden added a commit that referenced this issue Apr 7, 2020
@swharden
Copy link
Member

swharden commented Apr 7, 2020

Just published a NuGet package. It should be live shortly. Let me know if anything else comes up.

Thanks again @deiruch!

@swharden swharden closed this as completed Apr 7, 2020
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