Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matplotlib Error #103

Closed
kavanase opened this issue Jul 3, 2024 · 2 comments
Closed

Matplotlib Error #103

kavanase opened this issue Jul 3, 2024 · 2 comments

Comments

@kavanase
Copy link
Member

kavanase commented Jul 3, 2024

Running tp plot phonons sumo_band.yaml gives me:

Traceback (most recent call last):
  File "/Users/kavanase/miniconda3/bin/tp", line 33, in <module>
    sys.exit(load_entry_point('tp', 'console_scripts', 'tp')())
  File "/Users/kavanase/miniconda3/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/kavanase/miniconda3/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/kavanase/miniconda3/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/kavanase/miniconda3/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/kavanase/miniconda3/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/kavanase/miniconda3/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/kavanase/Packages/ThermoParser/tp/cli/cli.py", line 1597, in converge_phonons
    tp.plot.phonons.add_multi(ax, data, colour=colour, linestyle=linestyle,
  File "/Users/kavanase/Packages/ThermoParser/tp/plot/phonons.py", line 294, in add_multi
    colours = mpl.cm.get_cmap(colour)(np.linspace(0, 1, len(data)))
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'

I think I saw this error before actually, and manually fixed it. I think it might be due to a matplotlib version error? I'm using the most recent version

@kbspooner
Copy link
Collaborator

Right you are, its fixed now, thanks! (it maintains compatability with previous versions for now too)

@kavanase
Copy link
Member Author

@kbspooner just a suggestion, might be worth releasing a new version on pip with this and the other bug fixes you added? Doing pip install -U tp still gives the older versions with these issues, so would save the users some time in updating (without having to git clone etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants