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
5
votes
1 answer

Matplotlib plot over imshow while keeping axis size

Whenever I use imshow() to plot an image, plotting 1D data over it in a twinned bottom x-axis changes the size and aspect ratio of the initial x-axis created with for imshow(). How do I avoid this behavior? Here is how to reproduce the issue:…
Wall-E
  • 623
  • 5
  • 17
5
votes
2 answers

How do you update inline images in Ipython?

Edit: My question is not in regards to an "animation" per se. My question here, is simply about how to continuously show, a new inline image, in a for loop, within an Ipython notebook. In essence, I would like to show an updated image, at the same…
TheGrapeBeyond
  • 543
  • 2
  • 8
  • 19
5
votes
1 answer

matplotlib imshow -- use any vector as axis

I would like to use any vector as an axis in plt.imshow(). A = np.random.rand(4, 4) x = np.array([1, 2, 3, 8]) y = np.array([-1, 0, 2, 3]) I imagine something like this: plt.imshow(a, x_ax=x, y_ax=y) I know there is an extent parameter available,…
petervanya
  • 306
  • 4
  • 11
5
votes
1 answer

OpenCV python image washout

I am trying to get average merged image to show up using the following code: import numpy as np import cv2 import matplotlib.pyplot as plt dolphin=cv2.imread('dolphin.png',0) #Also tried without the 0 bicycle=cv2.imread('bicycle.png',0) The…
Omi
  • 136
  • 1
  • 10
5
votes
2 answers

imshow colormap figure and the suptitle don't align in the center

It's a very small issue but still I can't figure it out. I'm using imshow with matplotlib to plot a colormap - but the result is that the figure and the title are not aligned together: The code i'm using for the plot is: fig, ax =…
ValientProcess
  • 1,699
  • 5
  • 27
  • 43
5
votes
0 answers

Matplotlib imshow Dates axis

I have dataframe with dates and hours, for every hour (0 - 23) I have data for the corresponding date (2016-11-07 - 2016-11-27): 2016-11-07 2016-11-08 2016-11-09 2016-11-10 2016-11-11 2016-11-12 2016-11-13 2016-11-14 2016-11-15 …
ValientProcess
  • 1,699
  • 5
  • 27
  • 43
5
votes
3 answers

why my imshow differs from imwrite

I am using OpenCV 2.4.8 on VS2013. I have the following snippet of code: Mat img_sum = Mat::zeros(img_gray.size(), CV_32F); char file_name[FILENAME_MAX]; for (int i = 0; i < SCALE_SIZE; i++){ for (int j = 0; j < ORIENTATION_SIZE;…
Frank
  • 53
  • 6
5
votes
2 answers

How to completely remove the white space around a scatter plot

I am trying to plot a scatterplot over an image without having any white space around it. If I plot just the image as follows, then there is no white space: fig =…
fstab
  • 4,801
  • 8
  • 34
  • 66
5
votes
1 answer

Image gradually erased when overlayed with lines

Apart from the fact there exist special functions to plot vector fields, I have encountered a strange Matlab behaviour: Plotting an image (with imagesc or imshow) and overlaying it with colored lines (with plot or line) leads at some point to an…
matheburg
  • 2,097
  • 1
  • 19
  • 46
5
votes
3 answers

Creating intersecting images with imshow or other function

I have two 3-D arrays of ground penetrating radar data. Each array is basically a collection of time-lapse 2-D images, where time is increasing along the third dimension. I want to create a 3-D plot which intersects a 2-D image from each array. I'm…
Blake Lytle
  • 53
  • 1
  • 4
5
votes
1 answer

How do you annotate a matplotlib imshow map with an arrow *and* text?

I am trying to make an illustration that looks like this: But instead I get this: Here is my program: from pylab import * from matplotlib import colors # A = [[1,2,3,4,5]] A = [[0],[1]] Amap =…
vy32
  • 28,461
  • 37
  • 122
  • 246
4
votes
2 answers

Rotate a matrix with Matplotlib

I am rotating a n x n matrix (n = 20, although it could change) 30 degrees rightwards using Matplotlib's transformation methods. The error shows up because rotation is perfomed from the top and not from the base. I have tried to inverse the index…
Miguel Gonzalez
  • 706
  • 7
  • 20
4
votes
1 answer

TypeError: mat data type = 0 is not supported

I'd like use cv2.imshow("Otsu img", binary) instead of plt.imshow( binary) I got the error Full code: import matplotlib.pyplot as plt from skimage import io from skimage.filters.rank import entropy from skimage.morphology import disk import numpy as…
Redhwan
  • 927
  • 1
  • 9
  • 24
4
votes
3 answers

Why does a right click open a drop down menu in my OpenCV imshow() window?

I am trying to run the OpenCV Grabcut Sample on my system: OpenCV version 4.1.0 Python version 3.6.8 IDLE version 3.6.8 Ubuntu 18.04.2 This is the build information from cv2.getBuildInformation(): In the Grabcut Sample script, I need to 'draw a…
Stephen Meschke
  • 2,820
  • 1
  • 13
  • 25
4
votes
1 answer

Imshow in polar coordinates

I have disk simulation data with snapshots in a .dat file. I want to plot only one but in polar coordinates. I have: rho =…
jmgarrido
  • 41
  • 1
  • 4