Plots. Python tutorials. Jupyter Notebook. Math. XYPlots. To create a Jupyter notebook, follow these steps:
- Launch terminal.
- Select the location to create the Jupyter notebook (use the cd, mkdir commands).
- Type "jupyter notebook" in it.
- The browser with the Jupyter system web interface will launch.
- Click the "New" button and select "Python3 (pykernel)" from the drop-down menu.
- Click the "Add" button (the "+" sign) on the toolbar to create 2 more cells.
- In cell #1, enter the code: import matplotlib.pyplot as plt import numpy as np x = np.arange(-4,4,0.1) y = x ** 2 plt.plot(y)
- In cell №2, enter the code: import matplotlib.pyplot as plt import numpy as np x = np.arange(-4,4,0.1) y = x plt.plot(y)
- In cell #3, enter the code: import matplotlib.pyplot as plt import numpy as np x = np.arange(-10, -0.5, 0.1) y = 1 / x plt.plot(y) x = np.arange(0.5, 10, 0.1) y = 1 / x plt.plot(y)
- Click the "Run" button (black arrow) on the toolbar.
HelloWorld. Занятия Python. Блокноты Jupyter. Математика. Двухмерные графики функций. Для создания блокнота Jupyter нужно выполнить следующие действия:
- Запустить терминал.
- Выбрать место создания блокнота "Jupyter" (использовать комманды cd,mkdir).
- В нём набрать "jupyter notebook".
- Запустится браузер с веб интерфейсом системы "Jupyter".
- Нажать кнопку "New" и выпадающем меню выбрать пункт "Python3 (pykernel)".
- Нажать кнопку "Добавить" (знак "+") на панели инструментов для создания ещё 2 ячеек.
- В ячейке № 1 ввести код: import matplotlib.pyplot as plt import numpy as np x = np.arange(-4,4,0.1) y = x ** 2 plt.plot(y)
- В ячейке № 2 ввести код: import matplotlib.pyplot as plt import numpy as np x = np.arange(-4,4,0.1) y = x plt.plot(y)
- В ячейке № 3 ввести код: import matplotlib.pyplot as plt import numpy as np x = np.arange(-10, -0.5, 0.1) y = 1 / x plt.plot(y) x = np.arange(0.5, 10, 0.1) y = 1 / x plt.plot(y)
- Нажать кнопку "Выполнить" (чёрная стрелка) на панели инструментов.