X Tutup
Skip to content

ColorbarBase() is dpi dependent  #8378

@IvanAvdeevGth

Description

@IvanAvdeevGth

Hi everyone,

I find it out that there is a strange issue with matplotlib.colorbar.ColorbarBase(): when i save a figure with a colorbar in a vector format (such as pdf or eps) the colorbar is kinda jumps out its bounding axes object. First of all i tried to look at colorbar.solid objects, which seems to me as the main colour plot, but all the coordinates of this object was just fine.

To solve the problem of 'jumped out' colorbars i noticed that it depends on the dpi parameter in the figure.savefig() method. Anyway it is curious for me that dpi is actually a very important parameter for vector pictures (ofc if you use colorbars in such plots).

Examples of different plots are here in included files
cbar_dpi2.pdf
cbar_dpi5.pdf
cbar_dpi10.pdf
cbar_dpi20.pdf
cbar_dpi30.pdf
cbar_dpi50.pdf
cbar_dpi100.pdf
cbar_dpi200.pdf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup