All Questions
310 questions
1
vote
1
answer
45
views
Iteration of a graph approximation
The code below runs a model based on a graph generated by the solution to a system of differential equations and shows one with random 5% error added to the points. How would I iterate this process (...
1
vote
0
answers
41
views
How to plot only a certain area of data?
I am facing a problem that I can't solve. I have radar data, from which I want to plot the grid structure (rectangles) of a certain area. So far, I have the following:
#-- Get coordinates in the ...
0
votes
1
answer
47
views
Is there a way to print a desired x and y value directly from a graph using arrays in python? I also need to have the x axis at y = 0
Current plot with markers
import numpy as np
import matplotlib.pyplot as plt
import math as mth
x = np.array([0.0012,0.0006,0.0004,0.0003,0.00024,0.0002])
y = np.array([-160,-35,-4.2,9.0,16.9,21.3])
...
-1
votes
2
answers
245
views
How to reverse the slope of a graphed line
I'm trying to make a simple budget line graph that you would see in an economics class. But I need the slope of my line to be from 60 to 15 (inverse of what it is now).
I tried inversing the axis ...
-1
votes
1
answer
41
views
Splitting a large 3D array and plotting into colormap
I have some 3D structured array data and i want to process them into colormaps.
The array is very huge, and it looks like below when i print it.
[[[9.24908975e-05 9.24908975e-05 9.24908975e-05 ... 9....
2
votes
0
answers
29
views
How to convert a 3D plot into a 2D filled contour [duplicate]
I have a 3D plot that looks quite nice, and I'd like to convert this to a 2D filled contour plot, but I'm not quite sure how to do that. Here is my setup
import numpy as np
from mpl_toolkits.mplot3d ...
-1
votes
1
answer
48
views
What could be causing a visual discrepancy when displaying two identical numpy arrays using matplotlib's imshow()?
I have two arrays, array_questionable and array_comparison, which have the same shape, datatype, and contain the same values. However when displaying the arrays with axes[c, 1].imshow(...
0
votes
0
answers
117
views
matplotlib axes.fill_between() raises `TypeError: ufunc 'isfinite' not supported for the input types` for float arrays
I ran into this problem when I tried to fill the area between the x axis and the function graph with the following code:
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
...
0
votes
1
answer
80
views
Is there a way to plot an array directly (and only) on top of another array using matplotlib?
I have a 2D 5x5 array that contains 10 nan values (the remaining 15 are zeros), I want to plot a second 2D 5x5 array that contains 15 nan values (the remaining 10 are zeros) so that the 10 zeros of ...
1
vote
0
answers
39
views
How to plot a function that contain logarithm
I am a beginner, I try to plot the absolute square of a function that contain logarithm first I had an error saying:
Only size-1 arrays can be converted to Python scalars.
Then I tried to fix it by ...
1
vote
1
answer
46
views
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', '...
0
votes
1
answer
37
views
How to plot multiple lists where items are either of string or int datatype
Say i have the following 3 lists:
all_Ids = ["01", "02", 1, 2, 3, 4, 5]
all_xs = [12, 50, 36, 81, 70, 66, 34]
all_ys = [41, 50, 97, 22, 11, 89, 33]
Where the first contains node ...
0
votes
1
answer
264
views
How do I fix 'x and y must be the same size' error?
I'm brand new to Python and struggling with this error 'x and y must be the same size'
Here is the code for my scatter plot
def plotNumericalConvergence(paramArr, GrArr, Label):
plt.figure()
...
0
votes
1
answer
47
views
Trying to iterate through arrays and annotate them
I'm plotting graphs and I want to plot the values of the peaks which I've found using scipy. Now i have 2 numpy arrays that are the x values and y values of each peak. I want to go through these peaks ...
1
vote
1
answer
48
views
Cut out a smaller array shape from a bigger array
I have two sets of data in x and y arrays, one is from a theoretical calculation so it is far larger.
x1 = [1,2,3,4,5,6,7,8,9,10] y1 = [1,4,9,16,25,36,49,64,81,100]
the other is experimental so it ...