%global _empty_manifest_terminate_build 0 Name: python-japanize-matplotlib Version: 1.1.3 Release: 1 Summary: matplotlibのフォント設定を自動で日本語化する License: MIT License URL: https://github.com/uehara1414/japanize-matplotlib Source0: https://mirrors.nju.edu.cn/pypi/web/packages/aa/85/08a4b7fe8987582d99d9bb7ad0ff1ec75439359a7f9690a0dbf2dbf98b15/japanize-matplotlib-1.1.3.tar.gz BuildArch: noarch %description [![PyPI version](https://badge.fury.io/py/japanize-matplotlib.svg)](https://badge.fury.io/py/japanize-matplotlib) # japanize-matplotlib matplotlib を日本語表示に対応させます ## 利用方法 matplotlibをimportした後、japanize_matplotlibをimportします。 ```python import matplotlib.pyplot as plt import japanize_matplotlib plt.plot([1, 2, 3, 4]) plt.xlabel('簡単なグラフ') plt.show() ``` ![demo](https://raw.githubusercontent.com/uehara1414/japanize-matplotlib/master/demo.png?token=AOnChuZIQchUxiL0U8qlW633FM-RMSuvks5bxW8zwA%3D%3D "demo") ## インストール ```sh # pipenvで pipenv install japanize-matplotlib # またはpipで pip install japanize-matplotlib ``` ## 利用フォント IPAフォントのIPAexゴシック(Ver.003.01)を利用しています。 利用にあたっては[IPAフォントライセンスv1.0](https://github.com/uehara1414/japanize-matplotlib/blob/master/japanize_matplotlib/fonts/IPA_Font_License_Agreement_v1.0.txt)に同意してください。 ## FAQ ### import japanize_matplotlib したのに日本語表示になりません [#1](https://github.com/uehara1414/japanize-matplotlib/issues/1) import japanize_matplotlib してから matplotlib でグラフを描画するまでにフォントの設定が変わる処理が入っていると、日本語表示がなされない可能性があります。 例えば、seaborn を利用している場合であれば sns.set() などで描画フォントが seaborn のデフォルトに上書きされ、日本語表示がされなくなります。 sns.set(font="IPAexGothic") のように利用フォントに IPAexGothic を設定するか、フォント上書き後に japanize_matplotlib.japanize() を利用するなどで日本語表示できるはずです。 ### import のみして利用されないコードなのでフォーマッターに消されてしまいます リンターなどの警告が気になる・コードを消される方向けに japanize_matplotlib.japanize() メソッドの実行でも import 時と同じくフォントを設定できるようになっています。 無意味な実行になりますが、時と場合に応じて実行してください。 もしくはリンターごとに無視させる設定をすることで対応できるはずです。# noqa などで設定してください。 ### なぜインストール時は japanize-matplotlib で import 時は japanize_matplotlib なのですか? チェインケースが読みやすく好きだからです。import時にはチェインケースは利用できないのでスネークケースになっています。 %package -n python3-japanize-matplotlib Summary: matplotlibのフォント設定を自動で日本語化する Provides: python-japanize-matplotlib BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-japanize-matplotlib [![PyPI version](https://badge.fury.io/py/japanize-matplotlib.svg)](https://badge.fury.io/py/japanize-matplotlib) # japanize-matplotlib matplotlib を日本語表示に対応させます ## 利用方法 matplotlibをimportした後、japanize_matplotlibをimportします。 ```python import matplotlib.pyplot as plt import japanize_matplotlib plt.plot([1, 2, 3, 4]) plt.xlabel('簡単なグラフ') plt.show() ``` ![demo](https://raw.githubusercontent.com/uehara1414/japanize-matplotlib/master/demo.png?token=AOnChuZIQchUxiL0U8qlW633FM-RMSuvks5bxW8zwA%3D%3D "demo") ## インストール ```sh # pipenvで pipenv install japanize-matplotlib # またはpipで pip install japanize-matplotlib ``` ## 利用フォント IPAフォントのIPAexゴシック(Ver.003.01)を利用しています。 利用にあたっては[IPAフォントライセンスv1.0](https://github.com/uehara1414/japanize-matplotlib/blob/master/japanize_matplotlib/fonts/IPA_Font_License_Agreement_v1.0.txt)に同意してください。 ## FAQ ### import japanize_matplotlib したのに日本語表示になりません [#1](https://github.com/uehara1414/japanize-matplotlib/issues/1) import japanize_matplotlib してから matplotlib でグラフを描画するまでにフォントの設定が変わる処理が入っていると、日本語表示がなされない可能性があります。 例えば、seaborn を利用している場合であれば sns.set() などで描画フォントが seaborn のデフォルトに上書きされ、日本語表示がされなくなります。 sns.set(font="IPAexGothic") のように利用フォントに IPAexGothic を設定するか、フォント上書き後に japanize_matplotlib.japanize() を利用するなどで日本語表示できるはずです。 ### import のみして利用されないコードなのでフォーマッターに消されてしまいます リンターなどの警告が気になる・コードを消される方向けに japanize_matplotlib.japanize() メソッドの実行でも import 時と同じくフォントを設定できるようになっています。 無意味な実行になりますが、時と場合に応じて実行してください。 もしくはリンターごとに無視させる設定をすることで対応できるはずです。# noqa などで設定してください。 ### なぜインストール時は japanize-matplotlib で import 時は japanize_matplotlib なのですか? チェインケースが読みやすく好きだからです。import時にはチェインケースは利用できないのでスネークケースになっています。 %package help Summary: Development documents and examples for japanize-matplotlib Provides: python3-japanize-matplotlib-doc %description help [![PyPI version](https://badge.fury.io/py/japanize-matplotlib.svg)](https://badge.fury.io/py/japanize-matplotlib) # japanize-matplotlib matplotlib を日本語表示に対応させます ## 利用方法 matplotlibをimportした後、japanize_matplotlibをimportします。 ```python import matplotlib.pyplot as plt import japanize_matplotlib plt.plot([1, 2, 3, 4]) plt.xlabel('簡単なグラフ') plt.show() ``` ![demo](https://raw.githubusercontent.com/uehara1414/japanize-matplotlib/master/demo.png?token=AOnChuZIQchUxiL0U8qlW633FM-RMSuvks5bxW8zwA%3D%3D "demo") ## インストール ```sh # pipenvで pipenv install japanize-matplotlib # またはpipで pip install japanize-matplotlib ``` ## 利用フォント IPAフォントのIPAexゴシック(Ver.003.01)を利用しています。 利用にあたっては[IPAフォントライセンスv1.0](https://github.com/uehara1414/japanize-matplotlib/blob/master/japanize_matplotlib/fonts/IPA_Font_License_Agreement_v1.0.txt)に同意してください。 ## FAQ ### import japanize_matplotlib したのに日本語表示になりません [#1](https://github.com/uehara1414/japanize-matplotlib/issues/1) import japanize_matplotlib してから matplotlib でグラフを描画するまでにフォントの設定が変わる処理が入っていると、日本語表示がなされない可能性があります。 例えば、seaborn を利用している場合であれば sns.set() などで描画フォントが seaborn のデフォルトに上書きされ、日本語表示がされなくなります。 sns.set(font="IPAexGothic") のように利用フォントに IPAexGothic を設定するか、フォント上書き後に japanize_matplotlib.japanize() を利用するなどで日本語表示できるはずです。 ### import のみして利用されないコードなのでフォーマッターに消されてしまいます リンターなどの警告が気になる・コードを消される方向けに japanize_matplotlib.japanize() メソッドの実行でも import 時と同じくフォントを設定できるようになっています。 無意味な実行になりますが、時と場合に応じて実行してください。 もしくはリンターごとに無視させる設定をすることで対応できるはずです。# noqa などで設定してください。 ### なぜインストール時は japanize-matplotlib で import 時は japanize_matplotlib なのですか? チェインケースが読みやすく好きだからです。import時にはチェインケースは利用できないのでスネークケースになっています。 %prep %autosetup -n japanize-matplotlib-1.1.3 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-japanize-matplotlib -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Sun Apr 23 2023 Python_Bot - 1.1.3-1 - Package Spec generated