Skip to content

Commit

Permalink
Merge pull request #178 from raphaelquast/dev
Browse files Browse the repository at this point in the history
EOmaps v7.1
  • Loading branch information
raphaelquast authored Sep 5, 2023
2 parents 519122e + ebcd495 commit eed4100
Show file tree
Hide file tree
Showing 36 changed files with 2,132 additions and 602 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/testMaps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# set operating systems to test
os: [ubuntu-latest]
# set python versions to test
python-version: ["3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10"]

name: test_Maps ${{ matrix.os }} ${{ matrix.python-version }}
steps:
Expand All @@ -32,7 +32,7 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest

activate-environment: testMaps
activate-environment: eomaps

show-channel-urls: true
use-only-tar-bz2: true
Expand Down
124 changes: 119 additions & 5 deletions docs/EOmaps_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,85 @@

... a collection of examples that show how to create beautiful interactive maps.


.. |eximg01| image:: _static/fig1.gif
:width: 100%
:align: middle
:target: `ex_1`_
.. |eximg02| image:: _static/fig2.png
:width: 100%
:align: middle
:target: `ex_2`_
.. |eximg03| image:: _static/fig3.gif
:width: 100%
:align: middle
:target: `ex_3`_
.. |eximg04| image:: _static/fig4.gif
:width: 100%
:align: middle
:target: `ex_4`_
.. |eximg05| image:: _static/fig5.gif
:width: 100%
:align: middle
:target: `ex_5`_
.. |eximg06| image:: _static/fig6.gif
:width: 100%
:align: middle
:target: `ex_6`_
.. |eximg07| image:: _static/fig7.gif
:width: 100%
:align: middle
:target: `ex_7`_
.. |eximg08| image:: _static/fig8.gif
:width: 100%
:align: middle
:target: `ex_8`_
.. |eximg09| image:: _static/fig9.gif
:width: 100%
:align: middle
:target: `ex_9`_
.. |eximg10| image:: _static/example_row_col_selector.gif
:width: 100%
:align: middle
:target: `ex_10`_
.. |eximg11| image:: _static/example_inset_maps.png
:width: 100%
:align: middle
:target: `ex_11`_
.. |eximg12| image:: _static/example_lines.png
:width: 100%
:align: middle
:target: `ex_12`_
.. |eximg13| image:: _static/example_gridlines.png
:width: 100%
:align: middle
:target: `ex_13`_
.. |eximg14| image:: _static/example_contour.png
:width: 100%
:align: middle
:target: `ex_14`_

.. |eximg15| replace:: ...


.. table::
:width: 100%

+-----------+-----------+-----------+-----------+-----------+
| |eximg01| | |eximg02| | |eximg03| | |eximg04| | |eximg05| |
+-----------+-----------+-----------+-----------+-----------+
| |eximg06| | |eximg07| | |eximg08| | |eximg09| | |eximg10| |
+-----------+-----------+-----------+-----------+-----------+
| |eximg11| | |eximg12| | |eximg13| | |eximg14| | |eximg15| |
+-----------+-----------+-----------+-----------+-----------+

.. contents:: Contents:
:local:
:depth: 1


.. _ex_1:

Basic data visualization
-------------------------

Expand All @@ -30,6 +104,7 @@ There are 3 basic steps required to visualize your data:
.. image:: _static/fig1.gif
:width: 75%

.. _ex_2:

Customize the appearance of the plot
------------------------------------
Expand All @@ -44,14 +119,15 @@ Customize the appearance of the plot

|toggleStart|

.. literalinclude:: ../tests/example3.py
.. literalinclude:: ../tests/example2.py

|toggleEnd|

.. image:: _static/fig3.png
.. image:: _static/fig2.png
:width: 75%


.. _ex_3:

Data-classification and multiple Maps in a figure
-------------------------------------------------
Expand All @@ -67,14 +143,16 @@ Data-classification and multiple Maps in a figure

|toggleStart|

.. literalinclude:: ../tests/example2.py
.. literalinclude:: ../tests/example3.py

|toggleEnd|

.. image:: _static/fig2.gif
.. image:: _static/fig3.gif
:width: 75%


.. _ex_4:

Callbacks - turn your maps into interactive widgets
---------------------------------------------------

Expand Down Expand Up @@ -102,6 +180,8 @@ Callbacks - turn your maps into interactive widgets
:width: 75%


.. _ex_5:

Overlays, markers and annotations
---------------------------------

Expand All @@ -123,6 +203,9 @@ Overlays, markers and annotations
The data displayed in the above gif is taken from:
- NaturalEarth (https://www.naturalearthdata.com/)


.. _ex_6:

WebMap services and layer-switching
-----------------------------------

Expand All @@ -143,6 +226,8 @@ The data displayed in the above gif is taken from:
- OpenStreetMap hosted by Mundialis (https://www.mundialis.de/en/ows-mundialis/)


.. _ex_7:

Vektor data - interactive geometries
-------------------------------------

Expand Down Expand Up @@ -178,6 +263,8 @@ The data displayed in the above gif is taken from:
- NaturalEarth (https://www.naturalearthdata.com/)


.. _ex_8:

Using Scalebars
---------------

Expand Down Expand Up @@ -217,6 +304,8 @@ The data displayed in the above gif is taken from:



.. _ex_9:

Data analysis widgets - Timeseries and histograms
-------------------------------------------------

Expand All @@ -238,6 +327,8 @@ This example shows how to use EOmaps to analyze a database that is associated wi
:width: 75%


.. _ex_10:

Data analysis widgets - Select 1D slices of a 2D dataset
--------------------------------------------------------

Expand All @@ -259,7 +350,7 @@ Use custom callback functions to perform arbitrary tasks on the data when clicki
:width: 75%


.. _EOmaps_examples_inset_maps:
.. _ex_11:

Inset-maps - get a zoomed-in view on selected areas
---------------------------------------------------
Expand All @@ -285,6 +376,8 @@ Quickly create nice inset-maps to show details for specific regions.
:width: 75%


.. _ex_12:

Lines and Annotations
---------------------

Expand All @@ -310,6 +403,7 @@ Connect the anchor-points via:
:width: 75%


.. _ex_13:

Gridlines and Grid Labels
-------------------------
Expand All @@ -327,3 +421,23 @@ Draw custom grids and add grid labels.

.. image:: _static/example_gridlines.png
:width: 75%

.. _ex_14:

Contour plots and Contour Levels
--------------------------------

Use the ``contour``-shape to draw contour-plots of regular (or irregular data)
or to indicate contour-levels on top of other plots.

(requires EOmaps >= v7.1)

|toggleStart|

.. literalinclude:: ../tests/example_contour.py

|toggleEnd|


.. image:: _static/example_contour.png
:width: 75%
5 changes: 3 additions & 2 deletions docs/FAQ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ simply provide it as an explicit argument!
---------------------------

General changes in behavior
+++++++++++++++++++++++++++
~~~~~~~~~~~~~~~~~~~~~~~~~~~

- | 🔶 Starting with EOmaps v6.0 multiple calls to ``m.plot_map()``
| **on the same Maps-object completely remove (and replace)** the previous dataset!
Expand All @@ -226,7 +226,8 @@ General changes in behavior
- the ordering of artists inside a layer is determined by their ``zorder`` (e.g. ``m.plot_map(zorder=123)``)

Removed (previously depreciated) functionalities
++++++++++++++++++++++++++++++++++++++++++++++++
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- ❌ the ``m.figure`` accessor has been removed!

- Use ``m.ax``, ``m.f``, ``m.colorbar.ax_cb``, ``m.colorbar.ax_cb_plot`` instead
Expand Down
Binary file added docs/_static/example_contour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions docs/api_companion_widget.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,21 @@ EOmaps comes with an awesome companion widget that provides many useful features
matplotlib.use("qt5agg")
For more details, have a look at :ref:`configuring_the_editor`.



Additional information on Features and WebMaps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Starting with EOmaps v7.1 the widget provides a new useful functionality to **quickly access important
information** of :ref:`Features <ne_features>` and :ref:`WebMaps <webmap_layers>` that were used to create a map.

If there is additional information available for an artist of a map, a |question_symbol| symbol will appear
next to the corresponding entry in the **Edit** tab that will open a popup window containing the following information:

- **Notes** and **infos** on the features
- Links to **sources**, **references** and **licensing details** (without warranty for correctness!)
- The **source code** to reproduce the current appearance of the feature

.. image:: _static/minigifs/companion_widget_feature_info.gif
:width: 50%
22 changes: 11 additions & 11 deletions docs/api_data_visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ Possible shapes that work nicely for datasets with up to ~500 000 data-points:
delaunay_triangulation



Possible shapes that work nicely for up to a few million data-points:

.. autosummary::
:nosignatures:

raster
contour


While :py:class:`raster` can still be used for datasets with a few million datapoints, for extremely large datasets
Expand Down Expand Up @@ -218,7 +218,7 @@ Possible shapes that can be used to quickly generate a plot for extremely large
m2 = m.new_layer() # create a new Maps-object on the same layer
m2.set_data(data, x, y) # assign another dataset to the new Maps object
m2.set_shape.geod_circles(radius=50000, # draw geodetic circles with 50km radius
n=100) # use 100 intermediate points to represent the shape
n=100) # use 100 intermediate points to represent the shape
m2.plot_map(ec="k", cmap="Reds", # plot the data
zorder=2, set_extent=False) # (and avoid resetting the plot-extent)
Expand Down Expand Up @@ -428,25 +428,25 @@ To apply a uniform color to all datapoints, you can use `matpltolib's named colo
m.set_data(data=None, x=[10,20,30], y=[10,20,30])
# Use any of matplotlibs "named colors"
m1 = m.new_layer(copy_data_specs=True)
m1 = m.new_layer(inherit_data=True)
m1.set_shape.ellipses(radius=10)
m1.plot_map(fc="r", zorder=0)
m2 = m.new_layer(copy_data_specs=True)
m2 = m.new_layer(inherit_data=True)
m2.set_shape.ellipses(radius=8)
m2.plot_map(fc="orange", zorder=1)
# Use RGB or RGBA tuples
m3 = m.new_layer(copy_data_specs=True)
m3 = m.new_layer(inherit_data=True)
m3.set_shape.ellipses(radius=6)
m3.plot_map(fc=(1, 0, 0.5), zorder=2)
m4 = m.new_layer(copy_data_specs=True)
m4 = m.new_layer(inherit_data=True)
m4.set_shape.ellipses(radius=4)
m4.plot_map(fc=(1, 1, 1, .75), zorder=3)
# For grayscale use a string of a number between 0 and 1
m5 = m.new_layer(copy_data_specs=True)
m5 = m.new_layer(inherit_data=True)
m5.set_shape.ellipses(radius=2)
m5.plot_map(fc="0.3", zorder=4)
Expand All @@ -466,26 +466,26 @@ To explicitly color each datapoint with a pre-defined color, simply provide a li
# Use any of matplotlibs "named colors"
# (https://matplotlib.org/stable/gallery/color/named_colors.html)
m1 = m.new_layer(copy_data_specs=True)
m1 = m.new_layer(inherit_data=True)
m1.set_shape.ellipses(radius=10)
m1.plot_map(fc=["indigo", "g", "orange"], zorder=1)
# Use RGB tuples
m2 = m.new_layer(copy_data_specs=True)
m2 = m.new_layer(inherit_data=True)
m2.set_shape.ellipses(radius=6)
m2.plot_map(fc=[(1, 0, 0.5),
(0.3, 0.4, 0.5),
(1, 1, 0)], zorder=2)
# Use RGBA tuples
m3 = m.new_layer(copy_data_specs=True)
m3 = m.new_layer(inherit_data=True)
m3.set_shape.ellipses(radius=8)
m3.plot_map(fc=[(1, 0, 0.5, 0.25),
(1, 0, 0.5, 0.75),
(0.1, 0.2, 0.5, 0.5)], zorder=3)
# For grayscale use a string of a number between 0 and 1
m4 = m.new_layer(copy_data_specs=True)
m4 = m.new_layer(inherit_data=True)
m4.set_shape.ellipses(radius=4)
m4.plot_map(fc=[".1", ".2", "0.3"], zorder=4)
Expand Down
2 changes: 1 addition & 1 deletion docs/api_inset_maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ For convenience, inset-map objects have the following special methods defined:
InsetMaps.add_indicator_line


Checkout the associated example on how to use inset-maps: :ref:`EOmaps_examples_inset_maps`
Checkout the associated example on how to use inset-maps: :ref:`ex_11`

To quickly re-position (and re-size) inset-maps, have a look at the :ref:`layout_editor`!

Expand Down
Loading

0 comments on commit eed4100

Please sign in to comment.