About 55,400 results
Open links in new tab
  1. Change values on matplotlib imshow () graph axis - Stack Overflow

    Showing your image with matplotlib.pyplot.imshow is generally a fast way to display 2D data. However this by default labels the axes with the pixel count. If the 2D data you are plotting corresponds to some uniform grid defined by arrays x and y, then you can use matplotlib.pyplot.xticks and matplotlib.pyplot.yticks to label the x and y axes ...

  2. python - How to display an image - Stack Overflow

    plt.imshow(mpimg.imread('MyImage.png')) File_name = mpimg.imread('FilePath') plt.imshow(FileName) plt.show() you're missing a plt.show() unless you're in Jupyter notebook, other IDE's do not automatically display plots so you have to use plt.show() each time you want to display a plot or made a change to an existing plot in follow up code.

  3. Why matplotlib.pyplot.imsave() and matplotlib.pyplot.imshow() …

    Jan 6, 2019 · It seems matplotlib.imsave() lightens the image when compared to that of matplotlib.imshow(). For example, look at the code below. import imageio import matplotlib.pyplot as plt image = imageio.im...

  4. how to use 'extent' in matplotlib.pyplot.imshow - Stack Overflow

    Aug 9, 2011 · plt.imshow() but axes of real units, automatic "even" tick locations by Matplotlib? 0 Is there a way to change the units of the axes when plotting a 2D array as a colormap?

  5. python imshow, set certain value to defined color

    Jun 9, 2016 · import numpy as np import matplotlib import matplotlib.pyplot as plt value = -1 data = np.arange(100).reshape((10, 10)) data[5, :] = -1 # Values to set -1 masked_array = np.ma.masked_where(data == value, data) cmap = matplotlib.cm.spring # Can be any colormap that you want after the cm cmap.set_bad(color='white') plt.imshow(masked_array, cmap ...

  6. python - matplotlib plot and imshow - Stack Overflow

    plt.imshow() draws an image on the current figure (creating a figure if there isn't a current figure). Calling plt.show() before you've drawn anything doesn't make any sense. If you want to explictly create a new figure, use plt.figure() .

  7. How does the pyplot.imshow () function work? - Stack Overflow

    How does the pyplot.imshow() function work. I have a matrix of dimensions (20, 400). The matrix contains twenty images' decimal pixel values with each image of size (20px, 20px) (which can be seen as the second dimension of the matrix above). This matrix was then fed to the pyplot.imshow() with cmap chosen as gray.

  8. python - matplotlib.pyplot.imshow: removing white space within …

    Feb 28, 2013 · This looks like a bad interaction between the size/location of the axes object, the shared axes, and the equal aspect ratio from imshow. If you can live with out the ticks, you can do ax.set_axis_off() ax2.set_axis_off()

  9. How to update matplotlib's imshow () window interactively?

    Jul 24, 2013 · IMAGE_SIZE = 500 import numpy as np import matplotlib.pyplot as plt plt.ion() fig1, ax1 = plt.subplots() fig2, ax2 = plt.subplots() fig3, ax3 = plt.subplots() # this example doesn't work because array only contains zeroes array = np.zeros(shape=(IMAGE_SIZE, IMAGE_SIZE), dtype=np.uint8) axim1 = ax1.imshow(array) # In order to solve this, one ...

  10. Imshow subplots with the same colorbar - Stack Overflow

    Aug 1, 2013 · I want to make 4 imshow subplots but all of them share the same colormap. Matplotlib automatically adjusts the scale on the colormap depending on the entries of the matrices. For example, if one of...