<div dir="ltr">This is because `Arc` has a lot of logic in it's `draw` method to make sure that the arcs draw correctly and efficiently even if you are zoomed in an a small section, but uses the `Ellipse` patch as it's base (to manage the major/minor axis, location, etc).   `Ellipse` works by setting some internal state and then using the draw method from `Patch`.<div><br></div><div>What `art3d.pathpatch_2d_to_3d` does under the hood is change what `__class__` the object thinks it is (!!) and tells your Arc it is now a `Patch3D` and uses the state for the base Path state to draw its self, which due to inheriting from Ellipse is the full ellipse.</div><div><br></div><div>Having said that, I don't have a good idea of how to fix this.  I think the minimal solution is to adjust the path in `Arc` to clip it self to the given range (so the up-convert to Path3D works) and to make sure that the path re-sampling logic in the 2D draw still works on the pre-clipped path.</div><div><br></div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 22, 2020 at 4:38 AM Andreas Schneider <<a href="mailto:andreas_schn@web.de">andreas_schn@web.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I'm trying to plot an arc in a 3d plot using patches.Arc and<br>
art3d.pathpatch_2d_to_3d. However, although the arc is correctly shown<br>
from theta1 to theta2 in a 2d plot, the 3d plot always shows the full<br>
circle. Here is a minimal example:<br>
<br>
from matplotlib import pyplot as plt<br>
from matplotlib import patches<br>
from mpl_toolkits.mplot3d import art3d<br>
<br>
fig = plt.figure()<br>
ax = fig.add_subplot(111, projection='3d')<br>
p = patches.Arc((0, 0), 0.5, 0.5, angle=0., theta1=0., theta2=45.)<br>
ax.add_patch(p)<br>
art3d.pathpatch_2d_to_3d(p, z=0, zdir="y")<br>
plt.show()<br>
<br>
I get a whole circle but want to have an arc only from 0 degrees to 45<br>
degrees. A corresponding 2d plot shows the arc correctly:<br>
<br>
fig = plt.figure()<br>
ax = fig.add_subplot(111)<br>
p = patches.Arc((0, 0), 0.5, 0.5, angle=0., theta1=0., theta2=45.)<br>
ax.add_patch(p)<br>
plt.show()<br>
<br>
What am I doing wrong with the conversion from 2d to 3d?<br>
<br>
I tried Python 3.7.3 with Matplotlib 3.0.2 and Python 2.7.16 with<br>
Matplotlib 2.2.3 (which are shipped with my Linux distribution).<br>
<br>
Thanks in advance for your help.<br>
<br>
Andreas<br>
_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Thomas Caswell<br><a href="mailto:tcaswell@gmail.com" target="_blank">tcaswell@gmail.com</a></div>