Questions tagged [imshow]

The imshow is a function from the matplotlib library that displays an image on the axes.

The is a function from the library that displays an image on the axes.

References:

See also:

806 questions
10
votes
2 answers

How to give Matplolib imshow plot colorbars a label

We can give x and y axes labels for the main axes. Is there any way to similarly give a color bar a label? Alternately, is there any way to append a unit to one or more colorbar ticks?
Elliot
  • 5,211
  • 10
  • 42
  • 70
9
votes
2 answers

show image in its original resolution in jupyter notebook

I have a very high resolution(3311, 4681, 3) image, which I want to show in my jupyter notebook using opencv but as other answers stated its not possible to use cv2.imshow in the jupyter notebook, so i used plt.imshow to do the same but the problem…
Himanshu Poddar
  • 7,112
  • 10
  • 47
  • 93
9
votes
3 answers

Getting error in cv::imshow() - ASSERT: "false" in file qasciikey.cpp, line 501

I am getting this error whenever I call cv::waitKey(): ASSERT: "false" in file qasciikey.cpp, line 501 I am not sure why I am getting this error. I am running on an Ubuntu Server 14.04 EC2 instance connected through MobaXterm on Windows. If I run…
Georgi Angelov
  • 4,338
  • 12
  • 67
  • 96
8
votes
3 answers

TypeError: Invalid shape (3, 32, 32) for image data - showing a colored image in plt

I have an array of images where each image is stored as the following dimension (3, 32, 32) if I wanted to show an image using plt.imshow(img) then I am getting the following error: TypeError: Invalid shape (3, 32, 32) for image data I…
Wanderer
  • 1,065
  • 5
  • 18
  • 40
8
votes
2 answers

How to force same size between matplotlib subplot image axes

Suppose I have the following code to create three side-by-side images: n=10 x = np.random.rand(n,1) y = np.random.rand(1,n) z = np.random.rand(n,n) fig, ax = plt.subplots(1, 3) ax[0].imshow(x) ax[1].imshow(z) …
dkv
  • 6,602
  • 10
  • 34
  • 54
8
votes
1 answer

matplotlib pyplot imshow tight spacing between images

I have some numpy image arrays, all of the same shape (say (64, 64, 3)). I want to plot them in a grid using pyplot.subplot(), but when I do, I get unwanted spacing between images, even when I use pyplot.subplots_adjust(hspace=0, wspace=0). Below is…
Ray
  • 7,833
  • 13
  • 57
  • 91
8
votes
2 answers

Displaying image with matplotlib in ipython

How can I display an image imported with numpy package using matplotlib in ipython? It should be fairly easy with the command import numpy as np import matplotlib.pyplot as plt im = np.array(Image.open('image.jpg')) plt.imshow(im) But the image…
cerebrou
  • 5,353
  • 15
  • 48
  • 80
7
votes
1 answer

Matplotlib: imshow with second y axis

I'm trying to plot a two-dimensional array in matplotlib using imshow(), and overlay it with a scatterplot on a second y axis. oneDim = np.array([0.5,1,2.5,3.7]) twoDim = np.random.rand(8,4) plt.figure() ax1 = plt.gca() ax1.imshow(twoDim,…
Chris
  • 721
  • 1
  • 10
  • 23
7
votes
1 answer

How to control mouseover text in matplotlib

When you mouseover an image shown with imshow, you can mouseover the image to inspect its RGB values. The bottom-right corner of the matplotlib window (sharing space with the toolbar), shows the image coordinates and RGB values of the pixel being…
SuperElectric
  • 17,548
  • 10
  • 52
  • 69
7
votes
1 answer

update frame in matplotlib with live camera preview

I am new to both Python and Matplotlib. My computer is connected to two usb cameras, and I intend to use the subplot(1,2,1) and subplot(1,2,2) in matplotlib to plot the frames from the two camera in time series. When I do this with my code, I either…
jxw
  • 586
  • 2
  • 6
  • 36
7
votes
2 answers

What object does matplotlib.imshow() actually return? How to use this object?

I was trying to run the following code at the moment: imgplot = plt.imshow(dose_data, extent = [0,4,0,6], aspect = 'auto') On the console, I typed the following input: In[38]:imgplot Out[38]: And the…
Jibbah Dan
  • 71
  • 1
  • 2
7
votes
1 answer

cv::imshow sometimes is very slow

I've got a problem with cv::imshow. It normally consumes about 1-2 ms processing time for my image size but at some point in my processing-pipeline it uses 4-8 ms for the same kind of images. I have a method void Tool::displayImage() { …
Micka
  • 19,585
  • 4
  • 56
  • 74
6
votes
1 answer

Missing labels in Matplotlib correlation heatmap

I'm playing around with the abalone dataset from UCI's machine learning repository. I want to display a correlation heatmap using matplotlib and imshow. The first time I tried it, it worked fine. All the numeric variables plotted and labeled, seen…
MahiMai
  • 175
  • 3
  • 11
6
votes
1 answer

Align subplot with colorbar

I am trying to share the x-axis of a imshow that have to be square and a classique plot: the imshow has to be square with a colorbar the plot bellow should share the same axis (or at least look like align with the imshow) I spent two days on it,…
N.G
  • 367
  • 4
  • 10
6
votes
2 answers

Printing one color using imshow

I want to print a color on the screen using RGB values and the output should be just a single color. For example if I give RGB values of red, I want the output to show me a red color. But when I try this code, it isn't working. What am I…
Jp Reddy
  • 366
  • 1
  • 4
  • 15