Deltares / Deltares/imod-python

Introduce CrossSection, MapPlot, Plot3d classes

Open
#303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
41
Forks
12
Avg merge
21h 8m
Merged PRs (30d)
1

Description

In GitLab by @Huite on Dec 16, 2022, 10:37

The current functions require an enormous amount of keyword arguments to get right. This isn't very ergonomic or intuitive. It's probably better to enable a step by step approach in setting up the figure:

from imod.visualize import MapPlot

map_plot = MapPlot()
map_plot.set_basemap("Stamen")
map_plot.set_raster(dataarray)
map_plot.set_overlay(geodataframe)
map_plot.set_colormap(cmap)
map_plot.set_levels(levels)
map_plot.set_colorbar(where="right")
map_plot.set_title("My Head")
map_plot.show()

# tweak something
map_plot.set_colormap(other_cmap)
map_plot.show()

For subplots, with multiple figures, take an ax arg during initialization:

fig, axes = plt.subplots(nrow=2, ncol=2)

map_plot = MapPlot(ax=axes[0])
map_plot.set_raster()
map_plot_second = MapPlot(ax=axes[1])
# etc.

Would also be good to take up unstructured data.

Some challenges: is set_raster (or set_data) sufficient? What if you would like multiple data in a single plot?
Best to make an sequence:

map_plot = MapPlot()
map_plot.set_basemap("Stamen")
map_plot.set_raster([dataarray1, dataarray2])

Drawing order (zorder) is then defined by the order in the sequence.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the current visualization functions that CrossSection, MapPlot, and Plot3d would replace or wrap. Clarify the API for stepwise setup, subplot axes, multiple data layers, drawing order, and unstructured data before implementing; done means the proposed classes support the agreed workflows and existing plotting behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.