Skip to content

plt.subplot eats my subplots #11435

@ImportanceOfBeingErnest

Description

Bug report

Bug summary

plt.subplot eats my subplots. But it doesn't completely digest them, since they are still there, just not shown.

Creating a subplot grid with plt.subplots and in addition adding a plt.subplot removes those subplots from the grid, which are under the newly created subplot.
Creating the additional subplot via fig.add_subplot does not remove them.

Code for reproduction

import matplotlib.pyplot as plt
fig, ax = plt.subplots(2,3,
                       subplot_kw={"label" : "A"}, 
                       gridspec_kw={'width_ratios':[1,1,3]})
ax[0,2].plot([1,2,3])

axi = plt.subplot(133, label="B")
axi.plot([7,6,5], color="red")
axi.axis("off")

plt.show()

Actual outcome

image

Expected outcome

The expected outcome would be the same as with fig.add_subplot:

axi = fig.add_subplot(133, label="B")
axi.plot([7,6,5], color="red")
axi.axis("off")

image

Matplotlib version

  • Operating system: Win 8.1
  • Matplotlib version: master
  • Matplotlib backend: Qt5Agg
  • Python version: 3.6

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