Skip to main content

All Questions

0votes
1answer
72views

Why am I seeing two lines within each subplot?

I am currently working on graphing a set of signals' Fourier Transforms. The issue that I am currently facing is that there seems to be a flat line in every single subplot, whose origins I am unsure ...
Riderdie's user avatar
1vote
1answer
6kviews

TypeError: Dimensions of C (50, 49) should be one smaller than X(50) and Y(50) while using shading='flat' see help(pcolormesh)

My outputs T_results and c_results have values of 0 at the end, which I do not want so I sliced theses arrays excluding their last column and got their respective arrays T_results_cleaned = T_results[:...
NGA's user avatar
  • 45
1vote
1answer
42views

Mapping 2d point (x,y) into grid index (row,col)

I have a particular **Grid ** for robot navigation showing as so: I have scaled this by a factor of 10 to create my Environment. This is given in Cartesian coordinates I would like to map a point in ...
Sadiq's user avatar
1vote
2answers
125views

Plotting a cube on top of a plane, given all the vertices of the cube

I am tring to plot a cube on top of a plane using matplotib. I am doing a project on UAV(An unmanned aerial vehicle) Landing and there are these tests i have to visualize. I have a landing plane ...
Wanja Wilson's user avatar
0votes
1answer
426views

How to change color of a 3D scatter plot w.r.t. one value other than X,Y,Z

I have 4 numpy arrays for X, Y, Z, and Values. X= [20,30,50,60,..] Y= [25,35,55,65,...] Z= [5,6,7,8,...] Values = [-8,5,0.8,-1.2....] All arrays are of the same size and the index of all arrays is ...
A.k.'s user avatar
  • 302
-1votes
1answer
70views

why are numpy arrays printed like this?

Take for example generating random a 7x5x3 RGB image. import numpy as np import matplotlib.pyplot as plt # Create a random 7x5x3 RGB image image = np.random.randint(0, 256, size=(7, 5, 3), dtype=np....
QOTDIANA's user avatar
0votes
1answer
63views

Identifying grid cells in the first layer that pass through highlighted property regions across all 3d numpy Z layers

I have a 3D NumPy array representing porosity values in a subsurface reservoir, consisting of 40 layers with varying porosity distributions. Each layer is divided into a grid of size 50x50, resulting ...
Skylimit's user avatar
0votes
1answer
43views

Python linear prog. without using scipy.optimize.linprog OverflowError: cannot convert float infinity to integer

I tried to implement this transportation problem directly without using the scipy.optmize.lineprog library : (The Transportation Problem). Quantities a1, a2, . . . , a m, respectively, of a certain ...
Andy MWEPU's user avatar
0votes
3answers
732views

how to tackle numpy warnings

i am trying to generate a plot with annotations, the issue is that i have for each x value multiple y values correspond to it, so in order to keep x and y similar in size, i wrote the following: x = [...
sphero's user avatar
1vote
1answer
46views

Creating a curved array diagram without contours

So I have a python array and a code that produces a 2D representation of it: import numpy as np import matplotlib.pyplot as plt # Define the input data as a 2D NumPy array arr = np.array([ ['x', '...
Tom's user avatar
  • 55
1vote
1answer
867views

How could I generate a 2D array from a known slope and aspect value?

Given a dummy heightmap (or digital elevation model) stored as a Numpy array like this: import numpy as np import matplotlib.pyplot as plt line = np.flip(np.arange(0, 10)) dem = np.tile(line, (10, 1))...
user2950747's user avatar
0votes
1answer
265views

Problem plotting white plot using numpy array

import numpy as np import matplotlib as plt a = np.full((256, 256), 255, dtype=np.float32) plt.imshow(a, cmap='gray') I want to plot white plot but it is plotting black. I have also tried 0 and 1 ...
PScode's user avatar
0votes
0answers
80views

Invalid shape () for image data using matplotlib

I have the following two functions: def Rs(n1,n2,o): numerador = n1*np.cos(o) - n2*np.sqrt(1-(n1*np.sin(o)/n2)**2) denominador = n1*np.cos(o) + n2*np.sqrt(1-(n1*np.sin(o)/n2)**2) return (...
Unai Granados Ormaetxea's user avatar
3votes
1answer
1kviews

Confidence Interval 3 dimensional plot

I have a 3-dimensional plot and I am able to plot it with the code written below. Considering that my point distribution is represented by a 100x100 matrix, is it possible to plot a confidence ...
John_maddon's user avatar
-3votes
1answer
54views

Splitting arrays in imported file with Numpy

This is my first question here :) I have imported a csv file with np.loadtxt infile = np.loadtxt("glob_temp_anom_1.csv", dtype="int, float", delimiter=",", usecols=(0, 1),...
marloop007's user avatar

153050per page
close