質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Matplotlib

MatplotlibはPythonのおよび、NumPy用のグラフ描画ライブラリです。多くの場合、IPythonと連携して使われます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

PyCharm

エディター・開発ツール

Q&A

解決済

1回答

1244閲覧

pycharmのmatplotlibでのグラフ描写について

kashiwa_aaa

総合スコア10

Matplotlib

MatplotlibはPythonのおよび、NumPy用のグラフ描画ライブラリです。多くの場合、IPythonと連携して使われます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

PyCharm

エディター・開発ツール

0グッド

0クリップ

投稿2019/03/05 08:57

pycharmでmatplotlibを用いて一次関数のグラフを描写したい考えています。
基本的な教材を用いていて環境設定はpython3.7でpip,matplotlib,numpyとあとはデフォのものです。

発生している問題・エラーメッセージ

2019-03-05 17:50:19.588 python[23074:191280] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7fb3df0178d0 2019-03-05 17:50:19.590 python[23074:191280] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7fb3df0178d0' *** First throw call stack: ( 0 CoreFoundation 0x00007fff3395dded __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff5fa25720 objc_exception_throw + 48 2 CoreFoundation 0x00007fff339db195 -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x00007fff338ffa60 ___forwarding___ + 1486 4 CoreFoundation 0x00007fff338ff408 _CF_forwarding_prep_0 + 120 5 libtk8.6.dylib 0x000000011caaf31d TkpInit + 413 6 libtk8.6.dylib 0x000000011ca0717e Initialize + 2622 7 _tkinter.cpython-37m-darwin.so 0x000000011c82fa0f _tkinter_create + 1183 8 python 0x000000010989a8b6 _PyMethodDef_RawFastCallKeywords + 230 9 python 0x00000001099d7ba2 call_function + 306 10 python 0x00000001099d5852 _PyEval_EvalFrameDefault + 46114 11 python 0x00000001099c91fe _PyEval_EvalCodeWithName + 414 12 python 0x0000000109899587 _PyFunction_FastCallDict + 231 13 python 0x000000010991bc31 slot_tp_init + 193 14 python 0x0000000109925c01 type_call + 241 15 python 0x000000010989a283 _PyObject_FastCallKeywords + 179 16 python 0x00000001099d7c35 call_function + 453 17 python 0x00000001099d5946 _PyEval_EvalFrameDefault + 46358 18 python 0x000000010989a075 function_code_fastcall + 117 19 python 0x00000001099d7b27 call_function + 183 20 python 0x00000001099d5852 _PyEval_EvalFrameDefault + 46114 21 python 0x00000001099c91fe _PyEval_EvalCodeWithName + 414 22 python 0x0000000109899587 _PyFunction_FastCallDict + 231 23 python 0x000000010989d4a2 method_call + 130 24 python 0x000000010989aef2 PyObject_Call + 130 25 python 0x00000001099d5a9d _PyEval_EvalFrameDefault + 46701 26 python 0x00000001099c91fe _PyEval_EvalCodeWithName + 414 27 python 0x000000010989a783 _PyFunction_FastCallKeywords + 195 28 python 0x00000001099d7b27 call_function + 183 29 python 0x00000001099d588d _PyEval_EvalFrameDefault + 46173 30 python 0x000000010989a075 function_code_fastcall + 117 31 python 0x00000001099d7b27 call_function + 183 32 python 0x00000001099d588d _PyEval_EvalFrameDefault + 46173 33 python 0x00000001099c91fe _PyEval_EvalCodeWithName + 414 34 python 0x000000010989a783 _PyFunction_FastCallKeywords + 195 35 python 0x00000001099d7b27 call_function + 183 36 python 0x00000001099d588d _PyEval_EvalFrameDefault + 46173 37 python 0x00000001099c91fe _PyEval_EvalCodeWithName + 414 38 python 0x000000010989a783 _PyFunction_FastCallKeywords + 195 39 python 0x00000001099d7b27 call_function + 183 40 python 0x00000001099d5852 _PyEval_EvalFrameDefault + 46114 41 python 0x00000001099c91fe _PyEval_EvalCodeWithName + 414 42 python 0x0000000109a2c760 PyRun_FileExFlags + 256 43 python 0x0000000109a2bbd7 PyRun_SimpleFileExFlags + 391 44 python 0x0000000109a597bf pymain_main + 9583 45 python 0x000000010986cbbd main + 125 46 libdyld.dylib 0x00007fff60af3ed9 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

該当のソースコード

import matplotlib.pyplot as plt import numpy as np x = np.arange(0,10,0.5) y = 5 * x - 10 plt.plot(x,y) plt.show()

試したこと

試しにMACのターミナルで動かしてみましたらしっかりと描写できました。pycharmだと何がいけないのでしょうか。

初心者で至らぬ点もありますが、教えていただければ幸いです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

環境についてanacondaを導入したら解決できました。ありがとうございます。

投稿2019/03/05 09:17

kashiwa_aaa

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問