<p dir="auto"><a href="https://sourceforge.net/tracker/?func=detail&amp;aid=2015372&amp;group_id=80706&amp;atid=560721" rel="nofollow">Original report at SourceForge, opened Thu Jul 10 16:47:32 2008</a></p>
<p dir="auto">I'm using Ubuntu 7.10.  I have used the Synaptic manager to install Matplotlib (numpy and scipy as well).  Before that I tried installing them via the download and build.  I think that I have removed those efforts but I'm not certain of that.  I'm now trying to install basemap but it doesn't seem to be working.  I get the following when I try to build and install it.  What am I doing wrong?</p>
<p dir="auto">drew@drew-linux:<del>/Programs/PyROMS/basemap-0.99$ python setup.py build<br>
checking for GEOS lib in /usr/local ....<br>
checking for GEOS lib in /sw ....<br>
checking for GEOS lib in /opt ....<br>
checking for GEOS lib in /opt/local ....<br>
checking for GEOS lib in /home/drew ....<br>
Traceback (most recent call last):<br>
File "setup.py", line 80, in <br>
geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()]<br>
File "/usr/lib/python2.5/posixpath.py", line 62, in join<br>
elif path == '' or path.endswith('/'):<br>
AttributeError: 'NoneType' object has no attribute 'endswith'<br>
drew@drew-linux:</del>/Programs/PyROMS/basemap-0.99$ python setup.py install<br>
checking for GEOS lib in /usr/local ....<br>
checking for GEOS lib in /sw ....<br>
checking for GEOS lib in /opt ....<br>
checking for GEOS lib in /opt/local ....<br>
checking for GEOS lib in /home/drew ....<br>
Traceback (most recent call last):<br>
File "setup.py", line 80, in <br>
geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()]<br>
File "/usr/lib/python2.5/posixpath.py", line 62, in join<br>
elif path == '' or path.endswith('/'):<br>
AttributeError: 'NoneType' object has no attribute 'endswith'</p>
<h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">When adding text, if you use the (undocumented) kwarg <code class="notranslate">font</code>, it works but overwrites previous kwargs like <code class="notranslate">fontsize</code> and <code class="notranslate">fontstyle</code> with defaults.  This does not happen if you use other kwarg options like <code class="notranslate">fontname</code>, <code class="notranslate">name</code>, <code class="notranslate">fontdict['name']</code>, etc instead of <code class="notranslate">font</code>.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(4.5, 5))
ax.axis('off')
name = 'DejaVu Sans Mono'

ax.text(0,  1.05, &quot;kwarg fontsize&quot;, fontsize=20, name=name)
ax.text(0,  0.95, &quot;kwarg fontsize&quot;, name=name, fontsize=20)

ax.text(0,  0.8,  &quot;kwarg fontname&quot;, fontsize=20, fontname=name)
ax.text(0,  0.7,  &quot;kwarg fontname&quot;, fontname=name, fontsize=20)

ax.text(0,  0.55, &quot;kwarg fontdict['font']&quot;, fontsize=20, fontdict={'font': name})
ax.text(0,  0.45, &quot;kwarg fontdict['font']&quot;, fontdict={'font': name}, fontsize=20)

ax.text(0,  0.3,  &quot;kwarg fontdict['name']&quot;, fontsize=20, fontdict={'name': name})
ax.text(0,  0.2,  &quot;kwarg fontdict['name']&quot;, fontdict={'name': name}, fontsize=20)

ax.text(0,  0.05, &quot;kwarg font&quot;, fontsize=20, font=name)
ax.text(0, -0.05, &quot;kwarg font&quot;, font=name, fontsize=20)
plt.show()"><pre class="notranslate"><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-s1">fig</span>, <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-s1">figsize</span><span class="pl-c1">=</span>(<span class="pl-c1">4.5</span>, <span class="pl-c1">5</span>))
<span class="pl-s1">ax</span>.<span class="pl-en">axis</span>(<span class="pl-s">'off'</span>)
<span class="pl-s1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'DejaVu Sans Mono'</span>

<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">1.05</span>, <span class="pl-s">"kwarg fontsize"</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s1">name</span>)
<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.95</span>, <span class="pl-s">"kwarg fontsize"</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s1">name</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>)

<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.8</span>,  <span class="pl-s">"kwarg fontname"</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>, <span class="pl-s1">fontname</span><span class="pl-c1">=</span><span class="pl-s1">name</span>)
<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.7</span>,  <span class="pl-s">"kwarg fontname"</span>, <span class="pl-s1">fontname</span><span class="pl-c1">=</span><span class="pl-s1">name</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>)

<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.55</span>, <span class="pl-s">"kwarg fontdict['font']"</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>, <span class="pl-s1">fontdict</span><span class="pl-c1">=</span>{<span class="pl-s">'font'</span>: <span class="pl-s1">name</span>})
<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.45</span>, <span class="pl-s">"kwarg fontdict['font']"</span>, <span class="pl-s1">fontdict</span><span class="pl-c1">=</span>{<span class="pl-s">'font'</span>: <span class="pl-s1">name</span>}, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>)

<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.3</span>,  <span class="pl-s">"kwarg fontdict['name']"</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>, <span class="pl-s1">fontdict</span><span class="pl-c1">=</span>{<span class="pl-s">'name'</span>: <span class="pl-s1">name</span>})
<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.2</span>,  <span class="pl-s">"kwarg fontdict['name']"</span>, <span class="pl-s1">fontdict</span><span class="pl-c1">=</span>{<span class="pl-s">'name'</span>: <span class="pl-s1">name</span>}, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>)

<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>,  <span class="pl-c1">0.05</span>, <span class="pl-s">"kwarg font"</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>, <span class="pl-s1">font</span><span class="pl-c1">=</span><span class="pl-s1">name</span>)
<span class="pl-s1">ax</span>.<span class="pl-en">text</span>(<span class="pl-c1">0</span>, <span class="pl-c1">-</span><span class="pl-c1">0.05</span>, <span class="pl-s">"kwarg font"</span>, <span class="pl-s1">font</span><span class="pl-c1">=</span><span class="pl-s1">name</span>, <span class="pl-s1">fontsize</span><span class="pl-c1">=</span><span class="pl-c1">20</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/580326/108059262-232ee280-704d-11eb-9a4e-eae5fee13dc3.png"><img src="https://user-images.githubusercontent.com/580326/108059262-232ee280-704d-11eb-9a4e-eae5fee13dc3.png" alt="text_problem" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">One of these 2 options:</p>
<ul dir="auto">
<li>It should produce the correct results regardless of kwarg order.</li>
<li>kwarg <code class="notranslate">font</code> shouldn't work at all.</li>
</ul>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Matplotlib version: 3.3.4</li>
<li>Matplotlib backend: Qt5Agg</li>
<li>Python version: 3.9.1<br>
Installed via conda.</li>
</ul>