maziarraissi / PINNs

Physics Informed Deep Learning: Data-driven Solutions and Discovery of Nonlinear Partial Differential Equations
https://maziarraissi.github.io/PINNs
MIT License
3.45k stars 1.21k forks source link

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

Open WeiZhang111 opened 3 years ago

WeiZhang111 commented 3 years ago

...

radarFudan commented 2 years ago

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

lny161224 commented 2 years ago

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 commented 9 months ago

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 commented 9 months ago

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

zhengshichao1991 commented 8 months ago

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

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

PleaseWakeUpBUAA commented 4 months ago

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

PleaseWakeUpBUAA commented 4 months ago

@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 commented 3 months ago

@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
    ])