<h3 dir="auto">Bug summary</h3>
<p dir="auto">The keyword argument <code class="notranslate">transform</code> of the method ax.plot(...) malfunctions with size of the samples greater than 1000.</p>
<p dir="auto">For example, the following script</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms


ax = 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()"><pre class="notranslate"><code class="notranslate">import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms


ax = 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()
</code></pre></div>
<p dir="auto">Produces an expected figure</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8431900/132308652-075bd5b6-6d14-4eb9-8615-aeef15b1a737.png"><img src="https://user-images.githubusercontent.com/8431900/132308652-075bd5b6-6d14-4eb9-8615-aeef15b1a737.png" alt="Figure_1000" style="max-width: 100%;"></a></p>
<p dir="auto">with <code class="notranslate">num=1000</code></p>
<p dir="auto">and an empty figure</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8431900/132316353-90db4ede-cf60-4a5e-a850-d53f8e16047a.png"><img src="https://user-images.githubusercontent.com/8431900/132316353-90db4ede-cf60-4a5e-a850-d53f8e16047a.png" alt="Figure_1001" style="max-width: 100%;"></a></p>
<p dir="auto">with <code class="notranslate">num=1001</code>.</p>
<h3 dir="auto">Code for reproduction</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms


ax = 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()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">transforms</span> <span class="pl-k">as</span> <span class="pl-s1">transforms</span>


<span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">gca</span>()

<span class="pl-s1">xx</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">0.0</span>, <span class="pl-c1">4</span> <span class="pl-c1">*</span> <span class="pl-s1">np</span>.<span class="pl-s1">pi</span>, <span class="pl-s1">num</span><span class="pl-c1">=</span><span class="pl-c1">1001</span>)
<span class="pl-s1">yy</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">cos</span>(<span class="pl-s1">xx</span>)

<span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">transforms</span>.<span class="pl-v">Affine2D</span>().<span class="pl-en">translate</span>(<span class="pl-c1">10.0</span>, <span class="pl-c1">0.0</span>).<span class="pl-en">scale</span>(<span class="pl-c1">2.0</span>, <span class="pl-c1">0.5</span>)

<span class="pl-s1">lines</span> <span class="pl-c1">=</span> <span class="pl-s1">ax</span>.<span class="pl-en">plot</span>(<span class="pl-s1">xx</span>, <span class="pl-s1">yy</span>, <span class="pl-s1">transform</span><span class="pl-c1">=</span><span class="pl-s1">t</span> <span class="pl-c1">+</span> <span class="pl-s1">ax</span>.<span class="pl-s1">transData</span>)

<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<h3 dir="auto">Actual outcome</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8431900/132316487-226e2f0b-3c6a-4409-a70b-11eb256b6b26.png"><img src="https://user-images.githubusercontent.com/8431900/132316487-226e2f0b-3c6a-4409-a70b-11eb256b6b26.png" alt="Figure_1001" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8431900/132316499-b5fbb3f8-d5ce-4200-ab5e-d84a97183c87.png"><img src="https://user-images.githubusercontent.com/8431900/132316499-b5fbb3f8-d5ce-4200-ab5e-d84a97183c87.png" alt="Figure_1000" style="max-width: 100%;"></a></p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">Linux</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.4.3</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto">Qt5Agg</p>
<h3 dir="auto">Python version</h3>
<p dir="auto">Python 3.8.7</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Other libraries</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">pip</p>
<h3 dir="auto">Conda channel</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Bug summary</h3>
<p dir="auto">I have Windows 10, conda 4.10.3 with Python 3.9.7 and dependencies</p>
<p dir="auto">matplotlib-base==3.5.1<br>
matplotlib==3.5.1<br>
matplotlib-inline==0.1.3<br>
numpy==1.21.2<br>
numpy-base==1.21.2</p>
<p dir="auto">(amongst other installed packages). When I try to create plots using matplotlib.pyplot:</p>
<h3 dir="auto">Code for reproduction</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plt.plot(...)
# OR-
plt.scatter(...)
plt.show()"><pre class="notranslate"><span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(...)
<span class="pl-c"># OR-</span>
<span class="pl-s1">plt</span>.<span class="pl-en">scatter</span>(...)
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<h3 dir="auto">Actual outcome</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5 already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/."><pre class="notranslate"><code class="notranslate">OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5 already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
</code></pre></div>
<h3 dir="auto">Expected outcome</h3>
<p dir="auto">visualization</p>
<h3 dir="auto">Additional information</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating system</h3>
<p dir="auto">Windows 10</p>
<h3 dir="auto">Matplotlib Version</h3>
<p dir="auto">3.5.1</p>
<h3 dir="auto">Matplotlib Backend</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Python version</h3>
<p dir="auto">3.9.7</p>
<h3 dir="auto">Jupyter version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Installation</h3>
<p dir="auto">conda</p>
<p dir="auto">[<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tacaswell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tacaswell">@tacaswell</a> edited to add markup]</p>