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: Datetime Plots #7

Closed
geoffrey-eisenbarth opened this issue Oct 1, 2020 · 5 comments
Closed

Feature Request: Datetime Plots #7

geoffrey-eisenbarth opened this issue Oct 1, 2020 · 5 comments

Comments

@geoffrey-eisenbarth
Copy link

Wanted to say that I love this library and it has been super useful!

I am interested in helping add datetime support for the x-axis if it's something you're interested in. The particular case I'm thinking of is using a pandas Series with a datetime index. I haven't had a chance to dig into the source code yet, but was hoping to gauge interest in this kind of support and perhaps get pointers for where to start looking in the code. It seems like the x-axis must be integer based, which I assume is due to methods in place that scale the x-axis to fit into 80 lines. Hopefully I'll have time to get a better grasp of the ins and out of the code soon, but it would be great if we could work towards datetime-oriented axes.

If I've somehow missed the fact that this is possible with the library as is, please forgive me: I've only had a few days with the library.

Thanks!

@piccolomo
Copy link
Owner

Hi geoffrey-eisenbarth,

thanks a lot for your comment, I am glad you are enjoying the package!

For sure I would be interested in collaborating to include date-time support in the package.
I am now dealing with showing the real coordinates in the x and y axis for the next package update so your comment comes at the right time.

I am now busy with work but we could plan what to do and the functions needed to add the support, if you are still interested. What do you think?

Thanks and talk soon,
Savino

@piccolomo
Copy link
Owner

piccolomo commented Dec 20, 2020

Hi geoffrey-eisenbarth,

just in case you are still interested, I have just upgraded plotext to a new version. The documentation is available at pypi: plotext and github: plotext.

The package can be upgraded using pip install plotext --upgrade

all the best.

@piccolomo piccolomo reopened this Dec 20, 2020
@matthewhanson
Copy link

This is really neat library!

I'm also very interested in datetime support for the x-axis on histograms and plots. I'm using this in a CLI for querying geospatial data and quickly plotting values, but datetime is the most useful (to quickly see the temporal distribution of satellite images for instance).

I took a quick look at the code but there's a lot of moving parts so wasn't sure of where the main logic was that would need to be updated. Histograms are a bit more complicated than regular plotting as the binning will need to be done on the date fields.

@piccolomo
Copy link
Owner

Hi matthewhanson,

thanks for the reply, and I am glad you like the library. That is a feature I would definitively work on (in my free time from work which is not a lot).

I guess the first thing to understand is what is the standard used in Python to express dates and times and secondarily to create a function which given a list of dates (in the format chosen) returns a list of numbers spaced the right amount between one another equal to the time differences and a list of time labels as strings: the lists can be used to plot dates using the plt.xticks() function. what do you think?

any help is welcomed.

@piccolomo
Copy link
Owner

Hi @matthewhanson and @geoffrey-eisenbarth,

the newest version (3.0.0) of plotext is now available at this link.

Among the many changes, one can now also plot dates and times.

Hope it help and thanks for help!
Savino

@piccolomo piccolomo changed the title Support for Datetime Axis Feature Request: Datetime Plots Dec 11, 2021
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

3 participants