Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

macosx backend color rendering #5847

Closed
Closed
@jaguarondi

Description

@jaguarondi

With the macosx backend, images and patches are shown on screen with different color rendering. The Qt backend does work fine. The following script displays an image of a grayscale (np.array) overlaid at the center with the same grayscale generated from matplotlib.patches.

There is a difference of gamma between the image and the patches on what's displayed on screen but if I save this figure, then the resulting file is correct. Checking with some graphic software, the patches are displaying the correct color, not the image.

Snapshot:

Saving the figure from the figure window 'save' button gives this:

Here's the code to test:

import numpy as npimport matplotlib.pyplot as pltfrom matplotlib.patches import Rectanglecolor = np.zeros(3)f, ax = plt.subplots()im = np.zeros((1000, 1100,3))for i in range(11):    im[:,i*100:(i+1)*100,:] = np.tile(np.array([[color]]), (1000, 100, 1))    ax.add_patch(Rectangle((i*100,300), 100, 400, linewidth=0, facecolor=color))    color = color + 0.1plt.imshow(im)plt.show()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp