if you give a 2D array to the plot function of matplotlib it will assume the columns to be lines:
If x and/or y is 2-dimensional, then the corresponding columns will be plotted.
In your case your shape is not accepted (100, 1, 1, 8000). As so you can using numpy squeeze to solve the problem quickly:
np.squeez doc: Remove single-dimensional entries from the shape of an array.
import numpy as np import matplotlib.pyplot as plt data = np.random.randint(3, 7, (10, 1, 1, 80)) newdata = np.squeeze(data) # Shape is now: (10, 80) plt.plot(newdata) # plotting by columns plt.show()
But notice that 100 sets of 80 000 points is a lot of data for matplotlib. I would recommend that you look for an alternative. The result of the code example (run in Jupyter) is:
Related Posts:
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- ImportError: DLL load failed: The specified module could not be found
- ImportError: DLL load failed: The specified module could not be found
- ValueError: setting an array element with a sequence
- TypeError: only size-1 arrays can be converted to Python scalars (matplotlib)
- Numpy ValueError: setting an array element with a sequence. This message may appear without the existing of a sequence?
- numpy: Invalid value encountered in true_divide
- How do I create an empty array/matrix in NumPy?
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- numpy matrix vector multiplication
- Plotting a 2D heatmap with Matplotlib
- Convert pandas dataframe to NumPy array
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- size of NumPy array
- ValueError: all the input arrays must have same number of dimensions
- ValueError: setting an array element with a sequence
- Using Numpy Vectorize on Functions that Return Vectors
- Is there a NumPy function to return the first index of something in an array?
- Numpy/Python Array Value error
- initialize a numpy array
- TypeError: ‘DataFrame’ object is not callable
- load csv into 2D matrix with numpy for plotting
- How to access the ith column of a NumPy multidimensional array?
- Dump a NumPy array into a csv file
- Python: find position of element in array
- Overcome ValueError for empty array
- numpy with python: convert 3d array to 2d
- Python: slicing a multi-dimensional array
- How to remove specific elements in a numpy array
- Add single element to array in numpy
- How to normalize a 2-dimensional numpy array in python less verbose?
- Make list of arrays in python
- Understanding NumPy’s einsum
- ValueError: x and y must be the same size
- How to fix “TypeError: len() of unsized object”
- Numpy.dot TypeError: Cannot cast array data from dtype(‘float64’) to dtype(‘S32’) according to the rule ‘safe’
- Linear regression with matplotlib / numpy
- How to get the unit vector from a numpy array
- numpy-equivalent of list.pop?
- Using numpy to build an array of all combinations of two arrays
- Matplotlib: TypeError: can’t multiply sequence by non-int of type ‘numpy.float64’
- Efficiently sorting a numpy array in descending order?
- TypeError: only integer arrays with one element can be converted to an index 3
- How to create a numpy array of all True or all False?
- How to create a numpy array of lists?
- Removing nan values from an array
- IndexError: index 2 is out of bounds for axis 0 with size 2
- Root mean square of a function in python
- What are the differences between numpy arrays and matrices? Which one should I use?
- Numpy – add row to array
- Is there any numpy group by function?
- Mean Squared Error in Numpy?
- How to normalize a NumPy array to within a certain range?
- numpy array concatenation error: 0-d arrays can’t be concatenated
- Convert a 1D array to a 2D array in numpy
- inverting image in Python with OpenCV
- How to print the full NumPy array, without truncation?
- Sorting arrays in NumPy by column
- TypeError: zip argument #2 must support iteration
- numpy/scipy/ipython:Failed to interpret file as a pickle
- python numpy ValueError: operands could not be broadcast together with shapes
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- How to fix IndexError: invalid index to scalar variable
- Could not install packages due to a “Environment error :[error 13]: permission denied : ‘usr/local/bin/f2py'”
- How does numpy.newaxis work and when to use it?
- How to plot a histogram using Matplotlib in Python with a list of data?
- matplotlib error – no module named tkinter
- Singular matrix issue with Numpy
- ‘DataFrame’ object has no attribute ‘sort’
- TypeError: cannot unpack non-iterable int objec
- Is there a list of line styles in matplotlib?
- ‘End of statement expected’ in pycharm
- Change figure size and figure format in matplotlib
- Array of arrays (Python/NumPy)
- Using %matplotlib notebook after %matplotlib inline in Jupyter Notebook doesn’t work
- Display image as grayscale using matplotlib
- Pytorch reshape tensor dimension
- Plot a horizontal line using matplotlib
- How to add title to seaborn boxplot
- RuntimeWarning: divide by zero encountered in log
- How to update a plot in matplotlib?
- Error NameError: name ‘np’ is not defined
- How to change plot background color?
- NumPy array is not JSON serializable
- Does Numpy automatically detect and use GPU?
- How can I check whether a numpy array is empty or not?
- Plot correlation matrix using pandas
- Python, Matplotlib, subplot: How to set the axis range?
- Official abbreviation for: import scipy as sp/sc
- Building multi-regression model throws error: `Pandas data cast to numpy dtype of object. Check input data with np.asarray(data).`
- ImportError in importing from sklearn: cannot import name check_build
- Plot a histogram such that the total area of the histogram equals 1
- How to change legend size with matplotlib.pyplot
- An equivalent function to matplotlib.mlab.bivariate_normal
- Replacing Pandas or Numpy Nan with a None to use with MysqlDB
- How do I merge lists in python? [duplicate]
- Plotting a python dict in order of key values
- numpy : calculate the derivative of the softmax function
- Conditional indexing with Numpy ndarray
- python numpy machine epsilon