materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.48k stars 850 forks source link

error about "%matplotlib inline" #316

Closed QiWen0110 closed 8 years ago

QiWen0110 commented 8 years ago

<When reporting bugs/issues, please supply the following information. If this is a feature request, please simply state the requested feature.>

System

from pymatgen.matproj.rest import MPRester from pymatgen.electronic_structure.core import Spin

This initiliazes the Rest connection to the Materials Project db. Put your own API key.

a=MPRester("YOUR_API_KEY")

load the band structure from mp-3748, CuAlO2 from the MP db

bs=a.get_bandstructure_by_material_id("mp-3748") %matplotlib inline from pymatgen.electronic_structure.plotter import BSPlotter plotter=BSPlotter(bs) plotter.get_plot().show()

<Example code generating error>

Error message

File "", line 1 %matplotlib inline ^ SyntaxError: invalid syntax Basic functionality.pdf Analyze and plot band structures.pdf

<Error message>

Suggested solution (if any)

<If input files are needed to reproduce the error, please provide either links (e.g., Dropbox or GDrive) for large files or simply paste the file below for small files.>

<contents of file 1>
shyuep commented 8 years ago

This is not a bug. %matplotlib inline is only used in the ipython notebook. Take out the line and it should be fine.

QiWen0110 commented 8 years ago

Hi,Shyue Ping Ong,I tried on ipython,but it still doesn`t work! thank you for your help!

在 2016年3月25日,下午10:36,Shyue Ping Ong notifications@github.com 写道:

This is not a bug. %matplotlib inline is only used in the ipython notebook. Take out the line and it should be fine.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/materialsproject/pymatgen/issues/316#issuecomment-201315701

shyuep commented 8 years ago

Ipython Notebook. Just remove that line.

Shyue Ping On Mar 25, 2016 08:25, "QiWen" notifications@github.com wrote:

Hi,Shyue Ping Ong,I tried on ipython,but it still doesn`t work! thank you for your help!

在 2016年3月25日,下午10:36,Shyue Ping Ong notifications@github.com 写道:

This is not a bug. %matplotlib inline is only used in the ipython notebook. Take out the line and it should be fine.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/materialsproject/pymatgen/issues/316#issuecomment-201315701

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/materialsproject/pymatgen/issues/316#issuecomment-201332430