Skip to content

Shadow applied to a simple patch does not show #9377

@clintval

Description

@clintval

Bug report

Bug summary

Adding a shadow to a patch as described in the documentation does nothing. From the documentation it appears as if matplotlib.patches.Shadow accepts a patch object. I am also not clear on the units of the required ox and oy properties.

Code for reproduction

import matplotlib.pyplot as plt
import matplotlib.patches as mpatches

fig, ax = plt.subplots(1, 1, figsize=(5, 5))

rectangle = mpatches.Rectangle(
    xy=(0.25, 0.25),
    width=1/2,
    height=1/2)

shadow = mpatches.Shadow(
    rectangle,
    ox=0.5,
    oy=0.5)

ax.add_patch(rectangle)
ax.add_patch(shadow)

Actual outcome

download

Expected outcome

A shadow of the blue rectangle patch nearby.

Matplotlib version

  • Operating system: Manjaro 17.0.5
  • Matplotlib version: (2.0.2)
  • Matplotlib backend: module://ipykernel.pylab.backend_inline
  • Python version: 3.6.2

I installed matplotlib via the Arch package repositories at sudo pacman -S python-matplotlib.

Edit: added a missing import to make the example self-sufficient. (afvincent)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy