<div dir="ltr">OK, using ax.add_patch() together with ax.autoscale_view() (after adding all patches) gives the desired result.<div>Thanks!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 10:04 AM Elan Ernest <<a href="mailto:elch.rz@ruetz-online.de">elch.rz@ruetz-online.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To add a patch to an axes use `ax.add_patch()`.<br>
<br>
If you have several patches, consider using a collection, as shown in <br>
<a href="https://matplotlib.org/gallery/shapes_and_collections/collections.html" rel="noreferrer" target="_blank">https://matplotlib.org/gallery/shapes_and_collections/collections.html</a> <br>
or <br>
<a href="https://matplotlib.org/gallery/shapes_and_collections/patch_collection.html" rel="noreferrer" target="_blank">https://matplotlib.org/gallery/shapes_and_collections/patch_collection.html</a><br>
<br>
Am 21.03.2019 um 15:44 schrieb Neal Becker:<br>
> In this code, I add polygons and text annotations.  The result is plotted on<br>
> axes scaled [0..1], not autoscaled to match the data.  If I add e.g., a<br>
> scatterplot of the polygon centers, the result in scaled fine.  What's an<br>
> easy way to get the axes to scale correctly in this example?<br>
><br>
> for i, center in enumerate(centers):<br>
>      circle = mpl.patches.RegularPolygon ((center.real, center.imag), 6, 1,<br>
> fill=False, clip_on=False, linestyle='-', orientation=30*pi/180)<br>
>      ax.add_artist (circle)<br>
>      ax.annotate (beam_colors[i], xy=(center.real, center.imag),<br>
> textcoords='offset points', xytext=(-3,3))<br>
> plt.show()<br>
><br>
><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>
><br>
><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>