Inspired by this question, I've been trying to get images plotted without gaps.
In my toy example I have four images that I want to place in two rows. They have different shapes: different number of rows, same number of columns. Despite the…
I am testing scipy.misc.imshow and I got RuntimeError: Could not execute image viewer.
I am using Python3.4 and running it on CentOS 7.
import scipy.misc
img = scipy.misc.imread('Data/cat.jpg')
assert len(img.shape) == 3
img_resized =…
I have made the attached plot using the following codes:
a = 1
theta = np.linspace(0,2*np.pi,101)
x = np.linspace(-3*a,3*a,1001, dtype='complex')
y = np.linspace(-3*a,3*a,1001, dtype='complex')
X,Y = np.meshgrid(x,y)
# come manipulations with V
#…
I am trying to plot a scattered heat map on a defined geo location. I can very well plot a normal scattered map with no background but I want to combine it with a given lat and lon. I get the following empty map.
Input
Input: col[2] and col[3] are…
I am using plotly to show an image using fig=px.imshow(img)
I would like it to have a discret legend similar to the ones in the pie chart or the bar chart: fig2 = px.pie(df, values=df[0],names=df.index,color =df.index, color_discrete_map=…
I have a 2D NumPy array containing binary values (0 and 1) +1 additional value (-999) representing "no data".
Here's a dummy example:
import numpy as np
arr = np.random.randint(2, size=(100,))
# this no-data value has to be large compared to the…
I am a beginner using Python graphs, and I have a question about the matplotlib.pyplot.imshow function.
My goal is to model the expansion of an oil spill in the sea by using the method of the random walk in a grid made of a list of lists. Then, I…
I have two ndarrays: Mat, labels
Currently I display Mat:
plt.imshow(Mat, cmap='gray', vmin=0, vmax=1, interpolation='None')
labels has the same shape as Mat, and lables[(i,j)] contains a label of Mat[(i,j)].
How can I show the label on each pixel?
I have been trying to center the x and y ticks of my imshow but without success.
The desired yticks should be: [ 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000] and xticks: [ 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55] but…
I try to plot a layer on an imshow. This layer is based on a matrix where every values are equals to 0 but some specific pixels are equals to 1.
If I use the alpha parameter, I'm loosing mycolor as well... How can I have 0% transparency where I…
I have a small 2d vector to display:
import matplotlib.pyplot as plt
import numpy as np
img = np.random.rand(4,10)
plt.imshow(img, cmap='Reds')
As folllow:
But now I want to mark a specific cell, in order to focus the reader on that cell. Because…
OpenCV imshow function seems to work outside a function but not inside that function (and I don't think the answer is waitKey()). Why is this happening and how can I solve it?
I am learning 2D Gabor wavelets. For experimenting and observing I first…
I'd like to display some images while doing a numpy computation:
import numpy as np
import matplotlib.pyplot as plt
plt.ion() # Turn the interactive mode on.
for i in range(100):
A = np.random.randn(10,10)
plt.imshow(A)
…
I write a dog-classifier in a Jupyter notebook that, every time a dog is detected in an image, should show the image and print some text describing it. Somehow, the images are always displayed after all the text was printed, no matter in which order…
I'm trying to plot contours from one image of an object, let's say in band A, on top of a lower resolution image of that same object, let's say in band Z.
Both images are in large fits files, so I have to create a 2D cutout of each. However, the…