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: start x labels from 0 (instead of 1) for line and scatter plots #176

Open
Chareste opened this issue Jul 1, 2023 · 3 comments

Comments

@Chareste
Copy link

Chareste commented Jul 1, 2023

why don't they start from 0? If I'm giving you elements from a list, I want list[0] to be correctly placed in the 0 position. it shifts all the results by 1 and it's bad.

@piccolomo
Copy link
Owner

piccolomo commented Jul 6, 2023

Hello,
thanks for reporting. I am not quite involved in the project for now.

Try something like this:

import plotext as plt
data = [3,5,6,8]
l = len(data)
plt.plot(range(l), data)
plt.show()

I have not tested it but should work. The default behaviour shifts to 1 so that for example a bar plot (without the x labels provided) would start from 1 as well on the x axis. If the first bar is labelled 0, it would be awkward.

Perhaps I could create a function that changes this default behaviour? Or applies it only for bar plot? Any idea?

Thanks and all the best
Savino

@piccolomo
Copy link
Owner

Hello @Chareste,

I am back on plotext, sorry for late reply. Are you still interested?

@piccolomo piccolomo changed the title plots start from 1 and not from 0 Feature Request: start x labels from 0 (instead of 1) for line and scatter plots Aug 12, 2023
@piccolomo
Copy link
Owner

Just to update and apologise: I have been quite busy rewriting the package from ground up and will update.

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