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

cannot import name 'newfig' from 'plotting' #36

Open
WeiZhang111 opened this issue Jun 22, 2021 · 9 comments
Open

cannot import name 'newfig' from 'plotting' #36

WeiZhang111 opened this issue Jun 22, 2021 · 9 comments

Comments

@WeiZhang111
Copy link

...

@radarFudan
Copy link

radarFudan commented Sep 26, 2021

I also come across this problem. And I take a look at the help(plotting), there is no attribute newfig.

@lny161224
Copy link

The 'plotting' is coded in the document /Utilities,so u can add 'import sys' 'sys.path.insert(0, '../../Utilities/')' u can make it.(Try to make the/Utilities be the source Folders.
那个文件在/Utilities文件夹里,需要把这个文件夹加到项目的资源库中就能找到了

@wanghongyue-echo
Copy link

The 'plotting' is coded in the document /Utilities,so u can add 'import sys' 'sys.path.insert(0, '../../Utilities/')' u can make it.(Try to make the/Utilities be the source Folders. 那个文件在/Utilities文件夹里,需要把这个文件夹加到项目
这个是指我把源项那个地址改你所说那个代码改成我们目前电脑里面的位置吗,这样他就能自己调用plotting了吗,我改了之后还是有一些问题呀

@wanghongyue-echo
Copy link

ValueError: Key pgf.preamble: Could not convert ['\usepackage[utf8x]{inputenc}', '\usepackage[T1]{fontenc}'] to str出现了这个问题

@zhengshichao1991
Copy link

@wanghongyue-echo Did you solve the problem?
你解决这个问题了吗

ValueError: Key pgf.preamble: Could not convert ['\usepackage[utf8x]{inputenc}', '\usepackage[T1]{fontenc}'] to str出现了这个问题

@PleaseWakeUpBUAA
Copy link

@zhengshichao1991 请问你解决这个问题了吗?

@PleaseWakeUpBUAA
Copy link

PleaseWakeUpBUAA commented Mar 8, 2024

@zhengshichao1991 @wanghongyue-echo I have already solve this problem with the help of Chat GPT.我已经成功解决这个问题了,只需要在Utilities的plotting文件中将
"pgf.preamble": [
r"\usepackage[utf8x]{inputenc}", # use utf8 fonts becasue your computer can handle it :)
r"\usepackage[T1]{fontenc}", # plots will be generated using this preamble
]
更改为
"pgf.preamble": "\usepackage[utf8x]{inputenc}\n\usepackage[T1]{fontenc}",

@hjxiangbjtu
Copy link

hjxiangbjtu commented Apr 6, 2024

@zhengshichao1991 @wanghongyue-echo I have already solve this problem with the help of Chat GPT.我已经成功解决这个问题了,只需要在Utilities的plotting文件中将 "pgf.preamble": [ r"\usepackage[utf8x]{inputenc}", # use utf8 fonts becasue your computer can handle it :) r"\usepackage[T1]{fontenc}", # plots will be generated using this preamble ] 更改为 "pgf.preamble": "\usepackage[utf8x]{inputenc}\n\usepackage[T1]{fontenc}",

In matplotlib 3.x, you can replace these as

"pgf.preamble": "\n".join([
    r"\usepackage[utf8x]{inputenc}",    # use utf8 fonts becasue your computer can handle it :)
    r"\usepackage[T1]{fontenc}",        # plots will be generated using this preamble
    ])

@270415
Copy link

270415 commented Jul 23, 2024

@zhengshichao1991 @wanghongyue-echo I have already solve this problem with the help of Chat GPT.我已经成功解决这个问题了,只需要在Utilities的plotting文件中将 "pgf.preamble": [ r"\usepackage[utf8x]{inputenc}", # use utf8 fonts becasue your computer can handle it :) r"\usepackage[T1]{fontenc}", # plots will be generated using this preamble ] 更改为 "pgf.preamble": "\usepackage[utf8x]{inputenc}\n\usepackage[T1]{fontenc}",

In matplotlib 3.x, you can replace these as

"pgf.preamble": "\n".join([
    r"\usepackage[utf8x]{inputenc}",    # use utf8 fonts becasue your computer can handle it :)
    r"\usepackage[T1]{fontenc}",        # plots will be generated using this preamble
    ])

This works for me. :)

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

8 participants