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 (...
46
votes
4
answers
135k
views
Overlay an image segmentation with numpy and matplotlib
I am trying to overlay two images. The first one is a 512x512 NumPy array (from a CT image). The second one is also a 512x512 NumPy array but I am just interested in the pixels where the value is ...
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 ...
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, ...
-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 ...
55
votes
1
answer
261k
views
TypeError: Invalid dimensions for image data when plotting array with imshow()
For the following code
# Numerical operation
SN_map_final = (new_SN_map - mean_SN) / sigma_SN
# Plot figure
fig12 = plt.figure(12)
fig_SN_final = plt.imshow(SN_map_final, interpolation='nearest')
...
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])
...
0
votes
1
answer
2k
views
How would you go about plotting this data in 3d over time?
So,
The data looks like this:
(the spaces represent different columns, and the data represents 10 particles going around a central particle "Sun" and at different time steps in this case ...
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]],
...
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'...
-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....
0
votes
1
answer
422
views
How can I create an array of the grayscale color pixel values of a 28x28 matplotlib figure?
I am trying to code a neural network. I am in the very early stages and can't quite get past this problem. I have working code to extract an image from an MNIST database and form it into a matplotlib. ...
1
vote
1
answer
240
views
Drawing borders using gridlines in matplotlib pcolor grid by using an array of values
I have two arrays which I am plotting on a separate grid of nodes using colors. One represents some clusters and the other some other values I'll refer to as my features. Example code:
import numpy as ...
-1
votes
1
answer
1k
views
How to split data into two graphs with mat plot lib
I would be so thankful if someone would be able to help me with this. I am creating a graph in matplotib however I would to love to split up the 14 lines created from the while loop into the x and y ...
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()
...