Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using ginput on a plot_date plot doesn't return datetime #7462

Open
@dstansby

Description

@dstansby

When using ginput() on a plot made using plot_date(), the return type of the x value is float, but it should be datetime.

Minimal example:

importmatplotlib.pyplotaspltfromdatetimeimportdatetime,timedeltatimes= []data= []foriinrange(0,10):times.append(datetime(2016,1,1,0,0,0)+timedelta(seconds=i))data.append(i)plt.plot_date(times,data)x=plt.ginput()print(x[0][0])print(type(x[0][0]))

The last statement prints "<class 'numpy.float64'>"

  • Present on 2.0.0b4+2828.g86b32ca (installed from source using pip on Linux)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp