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

[Bug]: v3.5.2 causing plot to crash when plotting object with__array__ method #22973

Closed
@WilliamJamieson

Description

@WilliamJamieson

Bug summary

Inastropy/astropy#13209 a potential bug with v3.5.2 has been found wherein a previously working (e.g. in v3.5.1) plot of one of kernel objects now fails. This failure seems to stem fromplot no-longer coercing the the kernel object correctly. This seems to be related to the changes in#22141. In any case we have an object with a valid__array__ method which was previously plotting correctly, but now produces a crash.

Code for reproduction

importmatplotlib.pyplotaspltfromastropy.convolutionimportGaussian1DKernelgauss_1D_kernel=Gaussian1DKernel(10)plt.plot(gauss_1D_kernel,drawstyle='steps')

Actual outcome

Traceback (mostrecentcalllast):File"/home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/12943/lib/python3.9/site-packages/matplotlib/sphinxext/plot_directive.py",line517,in_run_codeexec(code,ns)File"<string>",line4,in<module>File"/home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/12943/lib/python3.9/site-packages/matplotlib/pyplot.py",line2769,inplotreturngca().plot(File"/home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/12943/lib/python3.9/site-packages/matplotlib/axes/_axes.py",line1632,inplotlines= [*self._get_lines(*args,data=data,**kwargs)]File"/home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/12943/lib/python3.9/site-packages/matplotlib/axes/_base.py",line312,in__call__yieldfromself._plot_args(this,kwargs)File"/home/docs/checkouts/readthedocs.org/user_builds/astropy/envs/12943/lib/python3.9/site-packages/matplotlib/axes/_base.py",line500,in_plot_argsifx.ndim>2ory.ndim>2:

Expected outcome

See:https://docs.astropy.org/en/latest/_images/astropy-convolution-Gaussian1DKernel-1.png

Additional information

No response

Operating system

No response

Matplotlib Version

3.5.2

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp