.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/lines_and_polygons/rotated_pole.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_lines_and_polygons_rotated_pole.py: Rotated pole boxes ------------------ A demonstration of the way a box is warped when it is defined in a rotated pole coordinate system. Try changing the ``box_top`` to ``44``, ``46`` and ``75`` to see the effect that including the pole in the polygon has. .. GENERATED FROM PYTHON SOURCE LINES 12-44 .. image-sg:: /gallery/lines_and_polygons/images/sphx_glr_rotated_pole_001.png :alt: rotated pole :srcset: /gallery/lines_and_polygons/images/sphx_glr_rotated_pole_001.png :class: sphx-glr-single-img .. code-block:: default import matplotlib.pyplot as plt import cartopy.crs as ccrs def main(): rotated_pole = ccrs.RotatedPole(pole_latitude=45, pole_longitude=180) box_top = 45 x, y = [-44, -44, 45, 45, -44], [-45, box_top, box_top, -45, -45] fig = plt.figure() ax = fig.add_subplot(2, 1, 1, projection=rotated_pole) ax.stock_img() ax.coastlines() ax.plot(x, y, marker='o', transform=rotated_pole) ax.fill(x, y, color='coral', transform=rotated_pole, alpha=0.4) ax.gridlines() ax = fig.add_subplot(2, 1, 2, projection=ccrs.PlateCarree()) ax.stock_img() ax.coastlines() ax.plot(x, y, marker='o', transform=rotated_pole) ax.fill(x, y, transform=rotated_pole, color='coral', alpha=0.4) ax.gridlines() plt.show() if __name__ == '__main__': main() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 2.570 seconds) .. _sphx_glr_download_gallery_lines_and_polygons_rotated_pole.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: rotated_pole.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: rotated_pole.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_