8000 fig.add_axes() with no arguments silently does nothing · Issue #15059 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
fig.add_axes() with no arguments silently does nothing #15059
Closed
@marko-knoebl

Description

@marko-knoebl

Bug report

Bug summary

Running fig.add_axes() without any arguments does nothing (and doesn't raise an error).

Code for reproduction

import matplotlib.pyplot as plt

fig = plt.figure()
new_axes = fig.add_axes()
print(new_axes)

Actual outcome

new_axes is None

the relevant code in add_axes reads:

...
if not len(args):
    return
...

Expected outcome

either of these:

  • raises an error
  • returns an axis object with a default size (like pyplot.axes())

Matplotlib version

  • Matplotlib version: 3.0.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0