Skip to content

[Bug]: Colorbar is displaced when saving as .eps with bbox_inches='tight' #25176

@Thomassien

Description

@Thomassien

Bug summary

I am plotting with imshow() and create a colorbar. When saving the figure as .eps with savefig() and option bbox_inches='tight', the colorbar (without the spines) is displaced.

Code for reproduction

import matplotlib.pyplot as plt

fig = plt.figure()
plt.imshow([[1, 1], [1, 1]])
plt.colorbar()
plt.savefig("test.eps", bbox_inches='tight')
plt.show()

Expected outcome

Colorbar should be placed inside the spines as when using plt.show(). Also, saving as .png instead of .eps works correctly.

Actual outcome

test

Additional information

The bug does not happen when using Matplotlib version 5.2.3.

Operating system

Windows 10

Matplotlib version

3.6.3

Matplotlib backend

module://backend_interagg

Python version

3.11.0

Metadata

Metadata

Assignees

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