Questions tagged [imshow]

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

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

References:

See also:

649 questions
96
votes
2 answers

Imshow: extent and aspect

I'm writing a software system that visualizes slices and projections through a 3D dataset. I'm using matplotlib and specifically imshow to visualize the image buffers I get back from my analysis code. Since I'd like to annotate the images with plot…
ngoldbaum
  • 4,818
  • 2
  • 24
  • 33
92
votes
2 answers

Python xticks in subplots

If I plot a single imshow plot I can use fig, ax = plt.subplots() ax.imshow(data) plt.xticks( [4, 14, 24], [5, 15, 25] ) to replace my xtick labels. Now, I am plotting 12 imshow plots using f, axarr = plt.subplots(4, 3) axarr[i,…
user2926577
  • 1,383
  • 2
  • 12
  • 13
76
votes
10 answers

OpenCV & Python - Image too big to display

I have an image that is 6400 × 3200, while my screen is 1280 x 800. Therefore, the image needs to be resized for display only. I am using Python and OpenCV 2.4.9. According to OpenCV Documentation, If you need to show an image that is bigger than…
Zynk
  • 1,791
  • 1
  • 9
  • 11
41
votes
1 answer

matplotlib imshow - default colour normalisation

I have consistently had problems with my colour maps when using imshow, some colours seem to just become black. I have finally realised that imshow seems to, by default, normalise the matrix of floating point values I give it. I would have expected…
oLas
  • 949
  • 1
  • 7
  • 17
36
votes
5 answers

Adjusting gridlines and ticks in matplotlib imshow

I'm trying to plot a matrix of values and would like to add gridlines to make the boundary between values clearer. Unfortunately, imshow decided to locate the tick marks in the middle of each voxel. Is it possible to a) remove the ticks but leave…
Joe Bathelt
  • 3,843
  • 2
  • 12
  • 13
33
votes
3 answers

Python - OpenCV - imread - Displaying Image

I am currently working on reading an image and displaying it to a window. I have successfully done this, but upon displaying the image, the window only allows me to see a portion of the full image. I tried saving the image after loading it, and it…
Sinjin Forde
  • 343
  • 1
  • 3
  • 6
27
votes
2 answers

Matplotlib : display array values with imshow

I'm trying to create a grid using a matplotlib function like imshow. From this array: [[ 1 8 13 29 17 26 10 4], [16 25 31 5 21 30 19 15]] I would like to plot the value as a color AND the text value itself (1,2, ...) on the same grid. This…
Ludovic Aphtes
  • 285
  • 1
  • 3
  • 8
25
votes
5 answers

Contour/imshow plot for irregular X Y Z data

I have data in X, Y, Z format where all are 1D arrays, and Z is the amplitude of the measurement at coordinate (X,Y). I'd like to show this data as a contour or 'imshow' plot where the contours/color represent the the value Z (amplitude). The grid…
Scientist
  • 341
  • 2
  • 4
  • 5
20
votes
3 answers

Fitting an image to screen using imshow opencv

I want to display an image using opencv on Mac os X 13'. The image size is 1920 × 1080. When I run this code, I see just a part of an image. I need to fit the image to the screen. #include #include #include…
BetterEnglish
  • 1,009
  • 2
  • 20
  • 38
20
votes
1 answer

Dates in the xaxis for a matplotlib plot with imshow

So I am new to programming with matplotlib. I have created a color plot using imshow() and an array. At first the axis were just the row and column number of my array. I used extent = (xmin,xmax,ymin,ymax) to get the x-axis in unix time and…
user3546200
  • 239
  • 3
  • 8
18
votes
2 answers

Drawing circles on image with Matplotlib and NumPy

I have NumPy arrays which hold circle centers. import matplotlib.pylab as plt import numpy as np npX = np.asarray(X) npY = np.asarray(Y) plt.imshow(img) // TO-DO plt.show() How can I show circles at the given positions on my image?
orkan
  • 336
  • 1
  • 3
  • 16
17
votes
1 answer

Two different color colormaps in the same imshow matplotlib

Let's suppose the example below import matplotlib.pyplot as plt import numpy as np v1 = -1 + 2*np.random.rand(50,150) fig = plt.figure() ax = fig.add_subplot(111) p = ax.imshow(v1,interpolation='nearest') cb =…
Marcos Alex
  • 1,300
  • 1
  • 13
  • 19
17
votes
2 answers

Showing an image with pylab.imshow()

I'm relatively new to all this and I started the tutorial on image analysis here. When trying to perform the pylab.imshow(dna) step it returns the following error: In [10]:…
Samuel Barnett
  • 424
  • 1
  • 3
  • 13
16
votes
5 answers

Image is not displaying in Google Colab while using imshow()

I am working on a project which requires functions from OpenCV to plot images. I am trying to display image using the below code in Google Colab. But nothing shows up in the output. Can anybody help me with this? %pylab notebook import cv2 testim =…
Alankrit Mishra
  • 373
  • 1
  • 2
  • 13
15
votes
2 answers

cv2.imshow image window placement is outside of viewable screen

I am running Anaconda install of python35 with cv2 install from menpo. I am having trouble with cv2.imshow() inconsistently placing the image window outside of the viewable screen when running code similar to the one below both as a standalone…
chiaka
  • 115
  • 1
  • 1
  • 9
1
2 3
43 44