All Questions
527 questions
1
vote
1
answer
46
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
50
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
vote
1
answer
283
views
Reading arrays from txt file in python to plot a graph
I'm new to python and want to plot a graph using data stored in arrays on a txt file...
content in the txt file ar just the arrays... nothing else.. exemple:
arrays.txt
[0, 1, 10, 5, 40, 1, 70] [12, ...
0
votes
0
answers
38
views
Animation of an array with matplotlib library
I want to animate my array as a scatter plot, this is the shape of my data:
data = np.array([[[[1], [2], [7], [1]],
[[2], [4], [9], [1]]],
[[[5], [2], [8], [1]],
...
-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 ...
0
votes
1
answer
102
views
How to assign scatter markers by dataframe column? How to avoid TypeError: unhashable type: 'Series' when creating string array from dataframe?
I'm trying to scatter plot data by year (column of dataframe) and assign marker type by detector used (column of dataframe). The following code generates the error 'TypeError: unhashable type: 'Series'...
0
votes
1
answer
44
views
individual matplotlib graphs for a dataframe with tickers
I am trying to display individual plots for a dataframe which contains tickers. The dataframe has 5 tickers, i.e., 5 companies from NASDAQ using yahoofinance.
This is how the all_data dataframe looks ...
-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
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', '...
-1
votes
1
answer
98
views
Plotting a graph using a function applied to elements in an array
I'm trying to plot a graph where the x-values are denoted by the array below:
player_number = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
And the y values correspond to the value of the ...