未分類

matplotlib で x軸・y軸ラベルをつける

投稿日:

plt.xlabel と plt.ylabel を使う。

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 2, 100)
plt.plot(x, x, label='linear')

plt.xlabel('x axis')
plt.ylabel('y axis')
plt.title("title")
plt.show()

結果

-未分類

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

tex で、表のキャプション内で改行する方法

\newline を使って次のように書く。 例 \begin{table} \begin{tabular}{ |c|c|c|c| } \hline 1 & 2 & 3 \\ \hlin …

no image

tex の表で、複数行を1行内に入れる方法

multirow パッケージを使っておき、表内で multirow で入力する。 例 \usepackage{multirow} \begin{document} \begin{table} \beg …

no image

C言語で文字をアルファベット順にずらす

C言語で文字をずらすには、char 型の変数に1を加えればよい。 例 #include <stdio.h> int main(void) { char c; c = ‘a’; c++; p …

no image

tex でダガー記号を入力する方法

ダガー記号には、$\dagger$ を使う。上付きにしたい場合には、$^$ と組み合わせる。 例 $A^{\dagger}$ 結果

no image

tex 大なり・小なり記号

tex で、「大なり」「小なり」を入力する方法通常の「大なり」「小なり」記号 例 $>$ $<$ 結果 参考 不等号を含むもの(大なりイコール・小なりイコール)を入力することもできる。イコールは …