Skip to content

Add support for cartopy v0.18 #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,9 @@ ProPlot v0.7.0 (2020-##-##)
ProPlot v0.6.0 (2020-##-##)
===========================

Rather than creating branches and opening pull requests, this release was
developed by running the testing suite on my local machine and making commits
directly to master. I will try to avoid this sort of workflow in the future.

.. rubric:: Deprecated

There are quite a lot of deprecations for this release. Since this is
There are quite a lot of deprecations for this release.

- Deprecate support for "parametric" plots inside `~matplotlib.axes.Axes.plot`,
instead use `~proplot.axes.Axes.parametric` (:commit:`64210bce`).
Expand Down Expand Up @@ -114,11 +110,15 @@ There are quite a lot of deprecations for this release. Since this is
`~proplot.styletools.LinearSegmentedColormap.truncated` to
`~proplot.styletools.LinearSegmentedColormap.truncate`, and
`~proplot.styletools.LinearSegmentedColormap.punched` to
`~proplot.styletools.LinearSegmentedColormap.cut` (:pr:`e1a08930`). The old
`~proplot.styletools.LinearSegmentedColormap.cut` (:commit:`e1a08930`). The old
method names remain with a deprecation warning.

.. rubric:: Features

- Support `cartopy 0.18 <https://scitools.org.uk/cartopy/docs/latest/whats_new.html>`__
locators, formatters, deprecations, and new labelling features (:pr:`158`).
- Add :rcraw:`geogrid.labelpad` and :rcraw:`geogrid.rotatelabels` settings
for cartopy gridline labels (:pr:`158`).
- Support more `~proplot.ticker.AutoFormatter` features on
`~proplot.ticker.SimpleFormatter` (:commit:`6decf962`).
- Support drawing colorbars with descending levels (:commit:`10763146`)
Expand Down
10 changes: 8 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Finally, the ``geoaxes``, ``land``, ``ocean``, ``rivers``, ``lakes``,
the corresponding :ref:`quick settings <rc_quick>` are turned on.

=============================== =========================================================================================================================================================================================================================================================
Key(s) Description
Key Description
=============================== =========================================================================================================================================================================================================================================================
``abc.style`` a-b-c label style. For options, see `~proplot.axes.Axes.format`.
``abc.loc`` a-b-c label position. For options, see `~proplot.axes.Axes.format`.
Expand Down Expand Up @@ -165,11 +165,17 @@ Key(s) Description
``geoaxes.facecolor`` Face color for the map outline patch.
``geoaxes.edgecolor`` Edge color for the map outline patch.
``geoaxes.linewidth`` Edge width for the map outline patch.
``geogrid.alpha`` Opacity of geographic gridlines.
``geogrid.color`` Color of geographic gridlines.
``geogrid.labelpad`` Default padding in points between map boundary edge and longitude/latitude labels.
``geogrid.labels`` Boolean, indicates whether to label the parallels and meridians.
``geogrid.labelsize`` Font size for latitude and longitude labels. Inherits from ``small``.
``geogrid.latmax`` Absolute latitude in degrees, poleward of which meridian gridlines are cut off.
``geogrid.lonstep`` Default interval for meridian gridlines in degrees.
``geogrid.latstep`` Default interval for parallel gridlines in degrees.
``geogrid.linestyle`` Line style for geographic gridlines.
``geogrid.linewidth`` line width for geographic gridlines.
``geogrid.lonstep`` Default interval for meridian gridlines in degrees.
``geogrid.rotatelabels`` Whether to rotate meridian and parallel gridline labels on cartopy axes.
``gridminor.linewidth`` Minor gridline width.
``gridminor.linestyle`` Minor gridline style.
``gridminor.alpha`` Minor gridline transparency.
Expand Down
6 changes: 4 additions & 2 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Hard requirements for notebook examples and documentation build
# Proplot itself just needs matplotlib
# NOTE: Basemap is broken as of matplotlib >=3.3 so for documentation
# use 3.2.1. Probably lots of basemap holdouts for next ~5 years.
# NOTE: PyQt5 is needed by pyplot, RTD server *happens* to already have it
# but creating local environment will fail.
name: proplot-dev
Expand All @@ -10,8 +12,8 @@ dependencies:
- numpy
- xarray
- pandas
- matplotlib
- cartopy=0.17
- matplotlib==3.2.1
- cartopy
- basemap
- pandoc
- ipykernel
Expand Down
14 changes: 8 additions & 6 deletions docs/projections.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.0
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
Expand Down Expand Up @@ -98,7 +99,7 @@
# default, but you can switch to basemap using ``basemap=True``.
# When you request map projections, `~proplot.ui.subplots` returns
# instances of `~proplot.axes.CartopyAxes` or `~proplot.axes.BasemapAxes`.

#
# * `~proplot.axes.CartopyAxes` joins the cartopy
# `~cartopy.mpl.geoaxes.GeoAxes` class with the ProPlot
# `~matplotlib.axes.Axes` class and adds a `~proplot.axes.GeoAxes.format`
Expand Down Expand Up @@ -163,10 +164,11 @@
},
ncols=2, nrows=5
)
axs.format(suptitle='Figure with several projections')
axs.format(coast=True, latlines=30, lonlines=60)
axs[:, 1].format(labels=True, lonlines=plot.arange(-180, 179, 60))
axs[-1, -1].format(labels=True, lonlines=30)
axs.format(
suptitle='Figure with several projections',
coast=True, latlines=30, lonlines=60, labels=True,
)
axs[-1, :].format(labels=True, lonlines=30)
axs.format(collabels=['Cartopy projections', 'Basemap projections'])
plot.rc.reset()

Expand Down
Loading