0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Google Colabで遊んでみる(Step1:図形表示)

Posted at

はじめに

表題通り、GoogleColabを触ってみようと思います!!何ができるかというイメージアップをしていきます!!
では、まず、図形を表示してみます

図形表示

# ================================================
# サイン波(Sin Wave)を描画するPythonコード
# 使用ライブラリ:NumPy(数値計算)、Matplotlib(グラフ描画)
# ================================================

# ライブラリをインポート(NumPy:数値計算用、Matplotlib:グラフ描画用)
import numpy as np
import matplotlib.pyplot as plt

# x軸の値を生成
# 0から10までを等間隔に100個に分割した配列を作る
# 例:[0.0, 0.101, 0.202, ..., 10.0]
x = np.linspace(0, 10, 100)

# y軸の値を生成
# xの値に三角関数 sin() を適用して、波の形(サイン波)を作る
y = np.sin(x)

# グラフを描画(xとyの折れ線グラフ)
plt.plot(x, y)

# グラフのタイトルを設定
plt.title("Sin Wave")

# グラフを表示する
plt.show()

image.png

めっちゃ簡単やな!!いいね!!どんどん書いていこう!!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?