Skip to content

Improve "fringy" look when plotting shaded dfsu. #760

@zweihuehner

Description

@zweihuehner

Description
When plotting a dfsu DataArray with plot_type="shaded", the triangles that lie close to elements that fell "dry" during a simulation are looking quite fringy. The underlying function is the matplotlib tripcolor in _FM_utils.py. Possibly the behavior is coming from matplotlib and can not be changed in mikeio.

To Reproduce
Load a dfsu dataset that comes from a m3fm simulation with dry falling elements. Plot a DataArray from the dataset like the following.

import mikeio
import matplotlib.pyplot as plt
ds = mikeio.read("example.dfsu")
fig, ax = plt.subplots(figsize = (14,14))
ds.Current_speed.plot(ax = ax, plot_type="shaded")

Example File:
example_dfsu.zip

Expected behavior
See a shaded plot without the fringy look of the triangle edges.

Screenshots
image

System information:

  • Python version: 3.10.10
  • MIKE IO version: 2.2.dev3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions