Just catch the exception and ignore it:
try: ax.set_ylim([y.min()-0.05, y.max()+0.05]) except ValueError: #raised if `y` is empty. pass
Related Posts:
- ImportError: DLL load failed: The specified module could not be found
- ImportError: DLL load failed: The specified module could not be found
- Plotting a 2D heatmap with Matplotlib
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- TypeError: ‘DataFrame’ object is not callable
- ValueError: x and y must be the same size
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- Linear regression with matplotlib / numpy
- Matplotlib: TypeError: can’t multiply sequence by non-int of type ‘numpy.float64’
- How to plot an array in python?
- IndexError: index 2 is out of bounds for axis 0 with size 2
- TypeError: zip argument #2 must support iteration
- numpy/scipy/ipython:Failed to interpret file as a pickle
- numpy max vs amax vs maximum
- TypeError: only size-1 arrays can be converted to Python scalars (matplotlib)
- Showing an image with pylab.imshow()
- How do you change the size of figures drawn with Matplotlib?
- What is the purpose of meshgrid in Python / NumPy?
- How to fix ‘Object arrays cannot be loaded when allow_pickle=False’ for imdb.load_data() function?
- ValueError: Unknown label type: ‘continuous’
- ImportError: No module named matplotlib.pyplot
- TypeError: unhashable type: ‘numpy.ndarray’
- data type not understood
- What does numpy.random.seed(0) do?
- What does the c underscore expression `c_` do exactly?
- ImportError: Missing required dependencies [‘numpy’]
- Error: all the input array dimensions except for the concatenation axis must match exactly
- numpy array concatenate: “ValueError: all the input arrays must have same number of dimensions”
- How to find all occurrences of an element in a list
- TypeError: ‘numpy.float64’ object is not callable
- TypeError: ‘numpy.float64’ object is not callable
- Convert a tensor to numpy array in Tensorflow?
- ‘DataFrame’ object has no attribute ‘sort’
- How to change the font size on a matplotlib plot
- filename.whl is not a supported wheel on this platform
- TypeError: ‘numpy.float64’ object is not callable?
- Convert a tensor to numpy array in Tensorflow?
- How to normalize a NumPy array to a unit vector?
- How to customize a scatter matrix to see all titles?
- What is dtype(‘O’), in pandas?
- How can I upgrade NumPy?
- How can the Euclidean distance be calculated with NumPy?
- How to get element-wise matrix multiplication (Hadamard product) in numpy?
- Matplotlib automatic legend outside plot
- Plot pie chart and table of pandas dataframe
- ModuleNotFoundError: No module named ‘matplotlib’
- Add Legend to Seaborn point plot
- What is dtype(‘O’), in pandas?
- ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
- Overflow Error in Python’s numpy.exp function
- ValueError: ‘object too deep for desired array’
- Purpose of `numpy.log1p( )`?
- LinAlgError: Last 2 dimensions of the array must be square
- How to take column-slices of dataframe in pandas
- Pytorch tensor to numpy array
- ‘numpy.float64’ object is not iterable
- How to change a ‘LinearSegmentedColormap’ to a different distribution of color?
- Normalize data in pandas
- Can’t broadcast input array from shape (3,1) into shape (3,)
- How do I calculate percentiles with python/numpy?
- deleting rows in numpy array
- How to increase plt.title font size?
- How to make a 3D scatter plot in matplotlib
- ‘list’ object has no attribute ‘shape’
- How to draw vertical lines on a given plot in matplotlib
- What is the difference between np.mean and tf.reduce_mean?
- Changing the “tick frequency” on x or y axis in matplotlib
- How can I set the aspect ratio in matplotlib?
- What does ‘index 0 is out of bounds for axis 0 with size 0’ mean?
- python SyntaxError: invalid syntax %matplotlib inline
- How to make a histogram from a list of data
- Moving average or running mean
- How do I change the figure size with subplots?
- Saving a Numpy array as an image
- Numpy extract submatrix
- numpy-equivalent of list.pop?
- Using numpy to build an array of all combinations of two arrays
- Can’t update to numpy 1.13 with anaconda?
- How to put the legend out of the plot
- RuntimeError: Invalid DISPLAY variable
- TypeError: only integer arrays with one element can be converted to an index 3
- Numpy, multiply array with scalar
- Python 3: Multiply a vector by a matrix without NumPy
- How to add a new row to an empty numpy array
- Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python
- Numpy – add row to array
- How do I compute derivative using Numpy?
- ImportError: cannot import name NUMPY_MKL
- plot a circle with pyplot
- Is there any numpy group by function?
- Mean Squared Error in Numpy?
- Is there a head and tail method for Numpy array?
- Difference between data type ‘datetime64[ns]’ and ‘
- Merging two DataFrames
- Transposing a 1D NumPy array
- numpy.float64 object is not iterable…but I’m NOT trying to
- vectorize conditional assignment in pandas dataframe
- Python OpenCV2 (cv2) wrapper to get image size?
- Equivalent to matlab’s imagesc in matplotlib? [duplicate]
- alueError: ordinal must be >= 1