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]: transform keyword in ax.plot(...) #21008

Closed
@kovalp

Description

@kovalp

Bug summary

The keyword argumenttransform of the method ax.plot(...) malfunctions with size of the samples greater than 1000.

For example, the following script

import numpy as npimport matplotlib.pyplot as pltimport matplotlib.transforms as transformsax = plt.gca()xx = np.linspace(0.0, 4 * np.pi, num=1001)yy = np.cos(xx)t = transforms.Affine2D().translate(10.0, 0.0).scale(2.0, 0.5)lines = ax.plot(xx, yy, transform=t + ax.transData)plt.show()

Produces an expected figure

Figure_1000

withnum=1000

and an empty figure

Figure_1001

withnum=1001.

Code for reproduction

importnumpyasnpimportmatplotlib.pyplotaspltimportmatplotlib.transformsastransformsax=plt.gca()xx=np.linspace(0.0,4*np.pi,num=1001)yy=np.cos(xx)t=transforms.Affine2D().translate(10.0,0.0).scale(2.0,0.5)lines=ax.plot(xx,yy,transform=t+ax.transData)plt.show()

Actual outcome

Figure_1001

Expected outcome

Figure_1000

Operating system

Linux

Matplotlib Version

3.4.3

Matplotlib Backend

Qt5Agg

Python version

Python 3.8.7

Jupyter version

No response

Other libraries

No response

Installation

pip

Conda channel

No response

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