problems plotting

Good aftenoon !!!

I am trying to plot a waveform in this way:

from obspy.core import read



but i am getting this error, I dont know why…

ValueError Traceback (most recent call last)
in ()
----> 1 st.plot()

/Applications/ in plot(self, *args, **kwargs)
997 from obspy.imaging.waveform import WaveformPlotting
998 waveform = WaveformPlotting(stream=self, *args, **kwargs)
–> 999 return waveform.plotWaveform(*args, **kwargs)
1001 def spectrogram(self, *args, **kwargs):

/Applications/ in plotWaveform(self, *args, **kwargs)
198 self.plotDay(*args, **kwargs)
199 else:
–> 200 self.plot(*args, **kwargs)
201 # Adjust the subplot so there is always a fixed margin on every side
202 if self.type != ‘dayplot’:

/Applications/ in plot(self, *args, **kwargs)
300 ((self.endtime - self.starttime) * sampling_rate >
301 self.max_npts):
–> 302 self.__plotMinMax(stream_new[_i], ax, *args, **kwargs)
303 else:
304 self.__plotStraight(stream_new[_i], ax, *args, **kwargs)

/Applications/ in __plotMinMax(self, trace, ax, *args, **kwargs)
653 min = data.min(axis=1) * tr.stats.calib
654 max = data.max(axis=1) * tr.stats.calib
–> 655 extreme_values[start: start + pixel_count, 0] = min
656 extreme_values[start: start + pixel_count, 1] = max
657 # First and last and last pixel need separate treatment.

/Applications/ in setitem(self, indx, value)
3025 _mask = ndarray.getattribute(self, ‘_mask’)
3026 # Set the data, then the mask
-> 3027 ndarray.setitem(_data, indx, dval)
3028 ndarray.setitem(_mask, indx, mval)
3029 elif hasattr(indx, ‘dtype’) and (indx.dtype == MaskType):

ValueError: operands could not be broadcast together with shapes (800) (801)

Thak you so much!!!

This looks like a bug for an edge case.. please open a ticket at github
and provide the data file for download somewhere.


I believe this is already fixed in the latest version. Can you upload the example file somewhere just in case so we can test it? Thanks.



Hi Lion and Tobias, here I am attaching a file wich I can not plot. I dont upload by github 'cause I am not sure about how does it work.

Thank you so much!!

2011.…BRR…HHE.CM.SAC (2.29 MB)

Hi Juan,

works fine for me. An update to the latest ObsPy version should fix your issues.



Hi Lion and Tobias,

I have 0.1.5 version, is there a newest version? if there is a new version I have to uninstall it or I can just update my version?

Than you very much!!!