ggventurini / python-deltasigma

A port of the MATLAB Delta Sigma Toolbox based on free software and very little sleep
python-deltasigma.io
Other
82 stars 54 forks source link

PlotPZ() does not show up #69

Open ldpgh opened 5 years ago

ldpgh commented 5 years ago
          ....
>>> ntf=synthesizeNTF(order=3, osr=32, opt=0)
>>> plotPZ(ntf, markersize=5)

.......\lib\site-packages\deltasigma\_plotPZ.py:85: MatplotlibDeprecationWarning: pyplot.hold is deprecated.
    Future behavior will be consistent with the long-time default:
    plot commands add elements without first clearing the
    Axes and/or Figure.
  hold_status = plt.ishold()
.....\lib\site-packages\deltasigma\_plotPZ.py:90: MatplotlibDeprecationWarning: pyplot.hold is deprecated.
    Future behavior will be consistent with the long-time default:
    plot commands add elements without first clearing the
    Axes and/or Figure.
  plt.hold(True)
....\lib\site-packages\matplotlib\__init__.py:910: MatplotlibDeprecationWarning: axes.hold is deprecated. Please remove it from your matplotlibrc and/or style files.
  mplDeprecation)
.....\lib\site-packages\matplotlib\rcsetup.py:156: MatplotlibDeprecationWarning: axes.hold is deprecated, will be removed in 3.0
  mplDeprecation)
>>>

Chart window does not come up.


>> python
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :
Type "help", "copyright", "credits" or "license" for more information.
>>>

To overcome this issue import matplotlib in front of deltasigma

import matplotlib.pyplot as plt   #BUG deltasigma ... 'Qt5Agg' prevents 'Agg'
from deltasigma import *
ntf=synthesizeNTF(order=3, osr=32, opt=0)
plotPZ(ntf, markersize=5)
plt.show()

plt.show() brings up the chart window.

romeshnandwana commented 3 years ago

In the new version of matplotlib the above solution doesn't work as hold is completely depreciated now. To fix it you have to comment out "plt.ishold()" and "plt.hold()" commands. The lines that use the above commands are 85,90,132, 133 in the _plotPZ.py file of the package. Comment these out and it works fine.