Skip to content

Setting the coordinate reference system #268

Description

@EricThomson

When plotting images with add_image() it doesn't show up in the conventional orientation, but upside down (same when using ImageWidget().

face = np.array([
   [0.6, .5, .5,  0.6, 0.5, 0.5, 0.6,], # row 0
   [0.6, 0.4, .5, 0.6, 0.4, 0.5, 0.6,], # row 0.6
   [0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6,], # row 2
   [0.6, 0.6, 0.6, 0.4, 0.6, 0.6, 0.6,], # row 3
   [0.6, 0.4, 0.6, 0.6, 0.6, 0.4, 0.6,], # row 4
   [0.6, 0.6, 0.4, 0.4, 0.4, 0.6, 0.6,], # row 5
   [0.5, 0.6, 0.6, 0.6, 0.6, 0.6, 0.5,], # row 6
]);

Matplotlib plt.imshow(face, cmap='gray') output:

mpl_imshow

Fastplotlib:

import fastplotlib as fpl
plot = fpl.Plot()
plot.add_image(data=face, cmap='gray')
plot.show()
add_image

Obviously there are conventions at play here with yaxis being switched being the norm for images.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions