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

Feature Request: Remove Decimal Points for Axes Numerical Ticks Made by Integers Only #136

Closed
darul75 opened this issue Oct 3, 2022 · 6 comments

Comments

@darul75
Copy link

darul75 commented Oct 3, 2022

Hello @piccolomo

Is there a way to display tick labels without unnecessary decimal values.

Screenshot 2022-10-03 at 13 35 11

Where here I would prefer seeing 1 instead of 1.0 etc.

Thank you,
Julien

@piccolomo
Copy link
Owner

Using the function yticks(ticks, labels) (explained in section Settings > Plot Ticks). Labels could be pure integers converted to string.

@piccolomo piccolomo changed the title Ticks without decimals (question) How To: Show Axes Ticks without Decimals Oct 3, 2022
@darul75
Copy link
Author

darul75 commented Oct 3, 2022

Read it but not carefully enough.

"xticks() to manually sets the ticks to the list of ticks provided; if two lists are provided, the second is intended as the list of string labels to be placed at the coordinates provided by the first,"

thank you

@darul75
Copy link
Author

darul75 commented Oct 3, 2022

Managed to do it for bar type chart but can not work out how to do the same for a stacked_bar chart where I got similar values on one axis (y axis).

@piccolomo
Copy link
Owner

Hi, I have solved this issue in the GitHub version tagged 5.2.8 (not yet published on PyPi). I tested it and it seem to work with axes ticks which are all integers, but if you could double check, I would be grateful. To install: pip install git+https://github.com/piccolomo/plotext.
Thanks for reporting!

@piccolomo piccolomo changed the title How To: Show Axes Ticks without Decimals Feature Request: Remove Decimal Points for Axes Numerical Ticks Made by Integers Only Oct 23, 2022
@darul75
Copy link
Author

darul75 commented Oct 27, 2022

hey, nice will test it soon and let you know

@piccolomo
Copy link
Owner

no problem, thank you anyway

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