# problems plotting

**URL:** <https://discourse.obspy.org/t/problems-plotting/249>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [December 17, 2013, 10:52pm UTC](https://discourse.obspy.org/t/problems-plotting/249 "2013-12-17T22:52:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcbermudezb](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jcbermudezb](https://discourse.obspy.org/u/jcbermudezb)\
**Post date:** [December 17, 2013, 10:52pm UTC](https://discourse.obspy.org/t/problems-plotting/249/1 "2013-12-17T22:52:58Z")

</div>

Good aftenoon !!!

I am trying to plot a waveform in this way:

from obspy.core import read

st=read(‘waveform.sac’)

st.plot()

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

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

/Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/core/stream.pyc 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)  
1000  
1001 def spectrogram(self, \*args, \*\*kwargs):

/Applications/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/imaging/waveform.pyc 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/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/imaging/waveform.pyc 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/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/obspy/imaging/waveform.pyc 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/ObsPy.app/Contents/MacOS/lib/python2.7/site-packages/numpy/ma/core.pyc 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!!!

---

<div class="post-metadata">

**Author:** ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)\
**Post date:** [December 18, 2013, 12:36am UTC](https://discourse.obspy.org/t/problems-plotting/249/2 "2013-12-18T00:36:05Z")

</div>

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

best,  
Tobias

---

<div class="post-metadata">

**Author:** ![LionKrischer](https://discourse.obspy.org/user_avatar/discourse.obspy.org/lionkrischer/32/219_2.png) [@LionKrischer](https://discourse.obspy.org/u/LionKrischer)\
**Post date:** [December 18, 2013, 1:34pm UTC](https://discourse.obspy.org/t/problems-plotting/249/3 "2013-12-18T13:34:09Z")

</div>

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.

Cheers!

Lion

---

<div class="post-metadata">

**Author:** ![jcbermudezb](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jcbermudezb](https://discourse.obspy.org/u/jcbermudezb)\
**Post date:** [December 20, 2013, 4:18am UTC](https://discourse.obspy.org/t/problems-plotting/249/4 "2013-12-20T04:18:56Z")

</div>

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.252.19.40.00.0..BRR..HHE.CM.SAC](https://discourse.obspy.org/uploads/short-url/4eKbuSSEWcfEp3TaqOGrJ6Q5rsz.SAC) (2.29 MB)

---

<div class="post-metadata">

**Author:** ![LionKrischer](https://discourse.obspy.org/user_avatar/discourse.obspy.org/lionkrischer/32/219_2.png) [@LionKrischer](https://discourse.obspy.org/u/LionKrischer)\
**Post date:** [December 20, 2013, 9:19am UTC](https://discourse.obspy.org/t/problems-plotting/249/5 "2013-12-20T09:19:32Z")

</div>

Hi Juan,

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

Cheers!

Lion

---

<div class="post-metadata">

**Author:** ![jcbermudezb](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jcbermudezb](https://discourse.obspy.org/u/jcbermudezb)\
**Post date:** [December 20, 2013, 1:20pm UTC](https://discourse.obspy.org/t/problems-plotting/249/6 "2013-12-20T13:20:44Z")

</div>

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!!!
