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
16
votes
2 answers

Plotting an imshow() image in 3d

How to plot a imshow() image in 3d axes? I was trying with this post. In that post, the surface plot looks same as imshow() plot but actually they are not. To demonstrate, here I took different data: import matplotlib.pyplot as plt from…
Raj
  • 333
  • 1
  • 3
  • 11
15
votes
2 answers

Plotting at full resolution with matplotlib.pyplot, imshow() and savefig()?

I have a medium-sized array (e.g. 1500x3000) that I want to plot at scale since it is an image. However, the vertical and horizontal scales are very different. For simplification let say that there is one meter/row and 10/column. The plot should…
Boorhin
  • 352
  • 1
  • 2
  • 10
15
votes
4 answers

Getting error - 'could not find a writer'while giving imshow, imwrite command opencv

I am a beginner at opencv and python. I have just installed opencv2.4.9 and enthought canopy-32bit. I am getting error for the following: import cv2 image = cv2.imread('Lena.jpg') cv2.imwrite('Mypic',image) This is what I…
Matt
  • 151
  • 1
  • 1
  • 4
14
votes
2 answers

Can we plot image data in Altair?

I am trying to plot image data in altair, specifically trying to replicate face recognition example in this link from Jake VDP's book - https://jakevdp.github.io/PythonDataScienceHandbook/05.07-support-vector-machines.html. Any one had luck plotting…
arjan-hada
  • 251
  • 3
  • 17
14
votes
1 answer

Animation quality is better with matshow() than with imshow(). How to improve it?

I displayed an array with matshow and it works fine but now I want to try imshow. The issue is that the quality of imshow is really poor compared to matshow. How can I fix this ? Matshow: matshow(array) Imshow: plt.imshow(array)
Loïc Poncin
  • 511
  • 1
  • 11
  • 30
14
votes
2 answers

Set two matplotlib imshow plots to have the same color map scale

I am trying to plot to fields with the same scale. The upper image values are a 10 times higher than the one bellow, but they turn out to be the same color in the imshow. How can I set both to have the same scales in colours? I added the code I am…
Ohm
  • 2,312
  • 4
  • 36
  • 75
14
votes
1 answer

how do I redraw an image using python's matplotlib?

What I am trying to do seems to be fairly straightforward, but I'm having a heck of a time trying to get it to work. I am simply trying to draw an image using imshow and then re-draw it periodically as new data arrives. I've started out with…
kjgregory
  • 656
  • 2
  • 12
  • 23
12
votes
3 answers

matplotlib 2D plot from x,y,z values

I am a Python beginner. I have a list of X values x_list = [-1,2,10,3] and I have a list of Y values y_list = [3,-3,4,7] I then have a Z value for each couple. Schematically, this works like that: X Y Z -1 3 5 2 -3 1 10 4 2.5 3 …
johnhenry
  • 1,293
  • 5
  • 21
  • 43
12
votes
2 answers

Remove white border when using subplot and imshow in python (Matplotlib)

import numpy as np import sys import matplotlib as mpl import matplotlib.pyplot as plt i use the following code to save an image fig, ax = plt.subplots(frameon=False) ax.axis ('off') ax.imshow …
refle
  • 587
  • 3
  • 6
  • 19
12
votes
3 answers

python imshow, set certain value to defined color

I have a RGB Image, which I plot with matplotlib.pyplot.imshow and it works fine. But now I want to change the plot, that where the value of the picture is e.g 1, the color of the plot should change to white at all this positions. Is there a way to…
Eva
  • 153
  • 1
  • 1
  • 4
11
votes
2 answers

Get interpolated data from imshow

I use matpotlib's imshow() to interpolate and plot some data. Here is a 2D array. im = ax.imshow(data2D,interpolation='sinc') I would like to get the 'sinc' interpolated data after imshow. I haven't been able to find any method to do so. Any…
Begbi
  • 148
  • 1
  • 5
11
votes
1 answer

Showing image title with imshow method in MATLAB

How can I show image titles in MATLAB figures? I have the following code below: I=imread('./../images/pap.png'); subplot(1,2,1); imshow(I); % here I want to show labels
it's me
  • 188
  • 1
  • 1
  • 10
10
votes
1 answer

Getting black plots with plt.imshow after multiplying RGB image array by a scalar

So I am a bit confused as to why this is happening. I have a binary image: Now I want to convert this binary image into RGB space, so therefore I use the dstack function to concatenate the 3rd axis Everything works fine so far, but now I have to…
YellowPillow
  • 4,100
  • 6
  • 31
  • 57
10
votes
1 answer

Plotting hsv values with imshow

I'm trying to plot hsv values using imshow in matplotlib. The problem is the method I'm using returns a tuple with three values as expected for hsv but imshow interpretes this as rgb. Is there a way of telling imshow that the values are hsv values?…
Neill Herbst
  • 2,072
  • 1
  • 13
  • 23
10
votes
1 answer

Log labels on colorbar

I have a logarithmic imshow figure, and when the colorbar is created, its axis labels and ticks are logarithmic, but because of the short range (0-50) of the values, the colorbar looks like this: and I would like it to instead show as 0, 5, 10, 20,…
Jbarrell
  • 121
  • 1
  • 1
  • 7
1 2
3
53 54