calc.dos.plot() does not show interactive graph

Question on input files/tags, interpreting output, etc.

Please check whether the answer to your question is given in the VASP online manual or has been discussed in this forum previously!

Moderators: Global Moderator, Moderator

Locked
Message
Author
reynaldo.putra
Newbie
Newbie
Posts: 8
Joined: Wed Jan 24, 2024 7:33 pm

calc.dos.plot() does not show interactive graph

#1 Post by reynaldo.putra » Tue Mar 12, 2024 6:03 pm

Hello everyone,

I tried following the tutorial provided here: py4vasp/0.4.0/; I am following the tutorial on Jupyter Notebook, and I am using a DOS calculation that I have completed.
In the last step, it is said that calc.dos.plot() will return an interactive figure of the plot. However instead of the plot, what I get is (possibly) the input for the graph/figure. Is there a step I am missing? Here is what calc.dos.plot() returns when I tried it:

>>> calc.dos.plot()
Graph(series=[Series(x=array([-17.63341421, -17.38701372, -17.14061322, -16.89421273,
-16.64781224, -16.40141175, -16.15501125, -15.90861076,
-15.66221027, -15.41580978, -15.16940928, -14.92300879,
-14.6766083 , -14.43020781, -14.18380731, -13.93740682,
-13.69100633, -13.44460584, -13.19820534, -12.95180485,
-12.70540436, -12.45900387, -12.21260337, -11.96620288,
-11.71980239, -11.4734019 , -11.2270014 , -10.98060091,
-10.73420042, -10.48779993, -10.24139943, -9.99499894,
-9.74859845, -9.50219796, -9.25579746, -9.00939697,
-8.76299648, -8.51659599, -8.27019549, -8.023795 ,
-7.77739451, -7.53099402, -7.28459352, -7.03819303,
-6.79179254, -6.54539205, -6.29899155, -6.05259106,
-5.80619057, -5.55979008, -5.31338958, -5.06698909,
-4.8205886 , -4.57418811, -4.32778761, -4.08138712,
-3.83498663, -3.58858614, -3.34218564, -3.09578515,
-2.84938466, -2.60298417, -2.35658367, -2.11018318,
-1.86378269, -1.6173822 , -1.3709817 , -1.12458121,
-0.87818072, -0.63178023, -0.38537973, -0.13897924,
0.10742125, 0.35382174, 0.60022224, 0.84662273,
1.09302322, 1.33942371, 1.58582421, 1.8322247 ,
2.07862519, 2.32502568, 2.57142618, 2.81782667,
3.06422716, 3.31062765, 3.55702815, 3.80342864,
4.04982913, 4.29622962, 4.54263012, 4.78903061,
5.0354311 , 5.28183159, 5.52823209, 5.77463258,
6.02103307, 6.26743357, 6.51383406, 6.76023455,
7.00663504, 7.25303554, 7.49943603, 7.74583652,
7.99223701, 8.23863751, 8.485038 , 8.73143849,
8.97783898, 9.22423948, 9.47063997, 9.71704046,
9.96344095, 10.20984145, 10.45624194, 10.70264243,
10.94904292, 11.19544342, 11.44184391, 11.6882444 ,
11.93464489, 12.18104539, 12.42744588, 12.67384637,
12.92024686, 13.16664736, 13.41304785, 13.65944834,
13.90584883, 14.15224933, 14.39864982, 14.64505031,
14.8914508 , 15.1378513 , 15.38425179, 15.63065228,
15.87705277, 16.12345327, 16.36985376, 16.61625425,
16.86265474, 17.10905524, 17.35545573, 17.60185622,
17.84825671, 18.09465721, 18.3410577 , 18.58745819,
18.83385868, 19.08025918, 19.32665967, 19.57306016,
19.81946065, 20.06586115, 20.31226164, 20.55866213,
20.80506262, 21.05146312, 21.29786361, 21.5442641 ,
21.79066459, 22.03706509, 22.28346558, 22.52986607,
22.77626656, 23.02266706, 23.26906755, 23.51546804,
23.76186853, 24.00826903, 24.25466952, 24.50107001,
24.7474705 , 24.993871 , 25.24027149, 25.48667198,
25.73307247, 25.97947297, 26.22587346, 26.47227395,
26.71867444, 26.96507494, 27.21147543, 27.45787592,
27.70427641, 27.95067691, 28.1970774 , 28.44347789,
28.68987838, 28.93627888, 29.18267937, 29.42907986,
29.67548035, 29.92188085, 30.16828134, 30.41468183,
30.66108232, 30.90748282, 31.15388331, 31.4002838 ,
31.64668429, 31.89308479, 32.13948528, 32.38588577,
32.63228626, 32.87868676, 33.12508725, 33.37148774,
33.61788823, 33.86428873, 34.11068922, 34.35708971,
34.6034902 , 34.8498907 , 35.09629119, 35.34269168,
35.58909217, 35.83549267, 36.08189316, 36.32829365,
36.57469414, 36.82109464, 37.06749513, 37.31389562,
37.56029611, 37.80669661, 38.0530971 , 38.29949759,
38.54589808, 38.79229858, 39.03869907, 39.28509956,
39.53150005, 39.77790055, 40.02430104, 40.27070153,
40.51710202, 40.76350252, 41.00990301, 41.2563035 ,
41.50270399, 41.74910449, 41.99550498, 42.24190547,
42.48830596, 42.73470646, 42.98110695, 43.22750744,
43.47390794, 43.72030843, 43.96670892, 44.21310941,
44.45950991, 44.7059104 , 44.95231089, 45.19871138,
45.44511188, 45.69151237, 45.93791286, 46.18431335,
46.43071385, 46.67711434, 46.92351483, 47.16991532,
47.41631582, 47.66271631, 47.9091168 , 48.15551729,
48.40191779, 48.64831828, 48.89471877, 49.14111926,
49.38751976, 49.63392025, 49.88032074, 50.12672123,
50.37312173, 50.61952222, 50.86592271, 51.1123232 ,
51.3587237 , 51.60512419, 51.85152468, 52.09792517,
52.34432567, 52.59072616, 52.83712665, 53.08352714,
53.32992764, 53.57632813, 53.82272862, 54.06912911,
54.31552961, 54.5619301 , 54.80833059, 55.05473108,
55.30113158, 55.54753207, 55.79393256, 56.04033305,
56.28673355]), y=array([0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 2.97735605e-02, 5.93784799e-02,
7.91816141e-02, 9.57545722e-02, 1.10772219e-01, 1.21926057e-01,
1.34503858e-01, 1.43684110e-01, 1.54272413e-01, 1.63038234e-01,
1.71832206e-01, 1.81094439e-01, 1.88428051e-01, 1.96429350e-01,
2.04617812e-01, 2.11427933e-01, 2.18747260e-01, 2.26394610e-01,
2.32872013e-01, 2.39586404e-01, 2.46680794e-01, 2.53671752e-01,
2.60138112e-01, 2.67199230e-01, 2.75317052e-01, 2.86141123e-01,
3.08612957e-01, 3.04477176e-01, 2.94826806e-01, 2.80694189e-01,
2.89602169e-01, 2.81859954e-01, 3.08746645e-01, 3.10464762e-01,
3.35633077e-01, 3.36327503e-01, 3.61995050e-01, 3.44102405e-01,
3.40268429e-01, 3.16512723e-01, 3.18360029e-01, 3.29576855e-01,
4.09449681e-01, 3.99842989e-01, 4.04599260e-01, 3.59183720e-01,
3.41923165e-01, 3.52019481e-01, 3.96443272e-01, 4.00863600e-01,
4.17562955e-01, 4.19297434e-01, 3.92374631e-01, 4.06548596e-01,
4.11532028e-01, 4.25359919e-01, 4.27035250e-01, 4.37463410e-01,
4.41105108e-01, 4.46093025e-01, 4.43542601e-01, 4.56321528e-01,
4.69725583e-01, 4.80498385e-01, 4.77646700e-01, 4.83023474e-01,
4.95343490e-01, 5.06748729e-01, 5.27259165e-01, 5.54128982e-01,
5.88071117e-01, 5.89180591e-01, 5.59586399e-01, 5.45853104e-01,
5.26982425e-01, 5.07242169e-01, 4.91399260e-01, 4.79317311e-01,
4.77691924e-01, 4.68094843e-01, 4.63004555e-01, 4.66981178e-01,
4.69126074e-01, 4.73521132e-01, 4.78369304e-01, 4.84697161e-01,
5.00315757e-01, 5.16080106e-01, 5.16341908e-01, 5.20788080e-01,
5.31754318e-01, 5.39774873e-01, 5.27845535e-01, 5.24950122e-01,
5.26963171e-01, 5.33915797e-01, 5.39523569e-01, 5.46419826e-01,
5.62207150e-01, 5.90115403e-01, 6.49927647e-01, 6.77646570e-01,
6.23576185e-01, 5.63157980e-01, 5.72265877e-01, 5.87365754e-01,
5.66788264e-01, 5.49088348e-01, 5.45453745e-01, 5.35765143e-01,
5.79996553e-01, 7.01767450e-01, 7.54425201e-01, 7.48121616e-01,
8.14847851e-01, 6.00865719e-01, 5.34893527e-01, 5.91984198e-01,
6.08299923e-01, 5.58020529e-01, 7.00312851e-01, 7.08097738e-01,
6.81257733e-01, 6.48394301e-01, 6.54380048e-01, 6.16550466e-01,
6.02519445e-01, 6.05565785e-01, 6.34884116e-01, 6.55011084e-01,
6.79281975e-01, 6.70644189e-01, 5.66315631e-01, 5.56895798e-01,
6.08396685e-01, 6.90811501e-01, 7.76172095e-01, 8.28870580e-01,
8.23921102e-01, 7.29562618e-01, 7.21445393e-01, 6.63685038e-01,
6.32246009e-01, 7.46263503e-01, 7.10713295e-01, 6.96636607e-01,
7.26956831e-01, 6.63062726e-01, 6.67080289e-01, 7.61098736e-01,
7.64108028e-01, 8.36616602e-01, 7.78923857e-01, 7.74978595e-01,
7.67378796e-01, 8.06787084e-01, 6.84304061e-01, 6.11227114e-01,
5.92375148e-01, 5.55994095e-01, 5.82683040e-01, 5.36723217e-01,
4.73997306e-01, 4.30632976e-01, 3.94517270e-01, 3.17387283e-01,
3.05685522e-01, 3.08021025e-01, 3.11593162e-01, 3.21665812e-01,
3.33038849e-01, 3.40644774e-01, 3.47193651e-01, 3.61238518e-01,
3.84109913e-01, 5.17645223e-01, 5.30542332e-01, 5.53604030e-01,
5.74559016e-01, 5.90323376e-01, 6.07035591e-01, 6.36052042e-01,
6.89762873e-01, 6.71946286e-01, 6.32675097e-01, 7.68762391e-01,
8.00500068e-01, 8.77108181e-01, 9.70890003e-01, 1.06051655e+00,
1.00179395e+00, 9.74836786e-01, 9.77479885e-01, 1.21744261e+00,
1.15313178e+00, 8.63857031e-01, 7.93774223e-01, 8.72186476e-01,
1.00054349e+00, 8.72715986e-01, 8.48204729e-01, 1.06904022e+00,
9.48987201e-01, 9.89981204e-01, 9.52621831e-01, 9.06185472e-01,
8.32124205e-01, 7.03018489e-01, 6.85291675e-01, 6.94371521e-01,
7.40166040e-01, 7.05668942e-01, 7.30433003e-01, 7.53591649e-01,
7.66595024e-01, 7.80259904e-01, 8.21786036e-01, 8.47639988e-01,
7.93956082e-01, 7.27728764e-01, 6.77530204e-01, 6.91860823e-01,
8.30061130e-01, 8.17276673e-01, 8.29469998e-01, 8.03709180e-01,
7.84926648e-01, 7.70570527e-01, 8.24417185e-01, 8.37795599e-01,
6.87609830e-01, 6.30623388e-01, 4.93896123e-01, 3.21099141e-01,
2.02996449e-01, 1.05854146e-01, 5.60787053e-02, 3.02231675e-02,
2.39183633e-02, 2.33273629e-02, 1.63651089e-02, 1.54084611e-02,
1.45707769e-02, 1.39068134e-02, 1.32607067e-02, 1.26324571e-02,
1.20220643e-02, 1.14295285e-02, 1.08548496e-02, 1.02980276e-02,
9.76185377e-03, 9.25865787e-03, 8.72468436e-03, 8.20984493e-03,
7.67912445e-03, 7.16615806e-03, 6.67094575e-03, 6.19348751e-03,
5.73378336e-03, 5.29183328e-03, 4.87516441e-03, 4.56842161e-03,
4.64987219e-03, 4.26470440e-03, 3.74742492e-03, 3.25801463e-03,
2.79647352e-03, 2.36280158e-03, 1.95699883e-03, 1.64928294e-03,
2.51942084e-03, 8.38564628e-04, 5.96312624e-05, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
0.00000000e+00]), name='total', width=None, y2=False, subplot=None, color=None, marker=None)], xlabel='Energy (eV)', xticks=None, ylabel='DOS (1/eV)', y2label=None, title=None)

andreas.singraber
Global Moderator
Global Moderator
Posts: 235
Joined: Mon Apr 26, 2021 7:40 am

Re: calc.dos.plot() does not show interactive graph

#2 Post by andreas.singraber » Mon Mar 18, 2024 9:49 am

Hello!

Are you sure you are running these commands from within a Jupyter notebook environment? This output I would expect if you are running directly from the Python console (indicated by the leading >>>).

Please try to follow the steps listed here before running the py4vasp commands: https://vasp.at/forum/viewtopic.php?p=25889#p25889

Let me know if the issue persists!

All the best,
Andreas Singraber

reynaldo.putra
Newbie
Newbie
Posts: 8
Joined: Wed Jan 24, 2024 7:33 pm

Re: calc.dos.plot() does not show interactive graph

#3 Post by reynaldo.putra » Tue Mar 19, 2024 3:39 pm

Thank you!
I was inexperienced and could not tell the difference between the console and the notebook environment. It is as you said, I tried plotting it on the console, which did not work...
Thank you very much for your help!

Locked