For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
2019-10-02: The community is currently in read-only mode

Help! deprecated() takes 1 positional argument but 2 were given



  • Hi, i need some help please. I tried to install matplotlib as you say but now i cant run the plot. i tried to change versions, reinstall anoaconda but now always have the same error and i cant show the plots as always. It give me this error:

    TypeError Traceback (most recent call last)
    <ipython-input-8-cf679b847698> in <module>
    1 # cerebro.plot(start=datetime.date(2005, 7, 1), end=datetime.date(2006, 1, 31))
    2
    ----> 3 fig = cerebro.plot(style='candle', numfigs=1, barup ='gold', bardown ='darkgoldenrod', valuetags=False, rowsmajor=5, rowsminor=2, plotdist=0.1)[0][0]
    4 fig.savefig('example.png', dpi=400)
    5 #figure = cerebro.plot(style ='candlebars')[0][0]

    ~\Anaconda3\lib\site-packages\backtrader\cerebro.py in plot(self, plotter, numfigs, iplot, start, end, width, height, dpi, tight, use, **kwargs)
    972
    973 if not plotter:
    --> 974 from . import plot
    975 if self.p.oldsync:
    976 plotter = plot.Plot_OldSync(**kwargs)

    ~\Anaconda3\lib\site-packages\backtrader\plot_init_.py in <module>
    31
    32
    ---> 33 from .plot import Plot, Plot_OldSync
    34 from .scheme import PlotScheme

    ~\Anaconda3\lib\site-packages\backtrader\plot\plot.py in <module>
    33 import numpy as np # guaranteed by matplotlib
    34 import matplotlib.dates as mdates
    ---> 35 import matplotlib.font_manager as mfontmgr
    36 import matplotlib.legend as mlegend
    37 import matplotlib.ticker as mticker

    ~\AppData\Roaming\Python\Python37\site-packages\matplotlib\font_manager.py in <module>
    46
    47 import matplotlib as mpl
    ---> 48 from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
    49 from matplotlib.fontconfig_pattern import (
    50 parse_fontconfig_pattern, generate_fontconfig_pattern)

    ~\AppData\Roaming\Python\Python37\site-packages\matplotlib\afm.py in <module>
    358
    359
    --> 360 @deprecated("3.0", "Use the class AFM instead.")
    361 def parse_afm(fh):
    362 return _parse_afm(fh)

    TypeError: deprecated() takes 1 positional argument but 2 were given


  • administrators

    @Aritz-Lizaso said in Help! deprecated() takes 1 positional argument but 2 were given:

    47 import matplotlib as mpl
    ---> 48 from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
    49 from matplotlib.fontconfig_pattern import (
    50 parse_fontconfig_pattern, generate_fontconfig_pattern)
    ~\AppData\Roaming\Python\Python37\site-packages\matplotlib\afm.py in <module>
    358
    359
    --> 360 @deprecated("3.0", "Use the class AFM instead.")
    361 def parse_afm(fh):
    362 return _parse_afm(fh)
    

    This is clearly something inside matplotlib apparently related to fonts.


Log in to reply
 

});