火山噴火に関する
あるdataFrameの一部です
eq_4_fifty_a.Year
time 1962-10-14 15:09:02 1962 1961-11-27 05:57:16 1961 1961-08-14 22:05:04 1961 1961-07-21 22:39:56 1961 1961-07-21 18:50:54 1961 1961-05-16 21:45:29 1961 1961-02-26 18:10:52 1961 1960-07-08 12:51:27 1960 1959-06-25 13:37:16 1959 1959-06-02 00:47:22 1959 1958-05-25 17:40:51 1958 Name: Year, dtype: object
eq_4_fifty_a.distance_km
time 1962-10-14 15:09:02 145.548154 1961-11-27 05:57:16 169.871453 1961-08-14 22:05:04 151.876279 1961-07-21 22:39:56 340.694030 1961-07-21 18:50:54 343.085268 1961-05-16 21:45:29 272.346034 1961-02-26 18:10:52 131.690445 1960-07-08 12:51:27 269.306102 1959-06-25 13:37:16 292.565117 1959-06-02 00:47:22 164.735842 1958-05-25 17:40:51 208.167460 Name: distance_km, dtype: float64
上記の2列で散布図を描きたい。
%matplotlib inline plt.style.use('ggplot') plt.figure(figsize=(15,5)) ax1 = plt.subplot(1,1,1) ax1.scatter(x=eq_4_fifty_b['distance_km'], y=eq_4_fifty_b['Year'], s=100, cmap='gist_earth') ax1.set_title('before') ax1.set_xlabel('distance') ax1.set_ylabel('year') ax1.set_xlim([0, 350]) # ax1.set_ylim([1950, 1956]) ax1.invert_yaxis() plt.show
このプロットだと1953年にデータがない、要するに噴火がなかったことをわからない。
どうしたらY軸に1950から1956年を順番に表示できるのですか
![説明]
ちなみに
ax1.set_ylim([1950, 1956])
でいけるかなと思ったがダメでした
latitude longitude depth mag \ time 1955-07-27 01:20:53 33.766 134.310 15.0 6.3 1954-04-13 15:25:42 32.918 134.346 15.0 5.9 1952-05-22 23:08:21 29.814 131.208 30.2 6.2 1951-10-15 21:02:01 32.863 134.404 20.5 6.1 1951-06-05 16:57:45 29.796 131.304 35.0 6.7 1950-12-05 21:53:38 29.770 131.200 25.0 6.0 1950-11-05 17:37:33 33.504 134.754 25.0 6.7 1950-05-31 13:13:14 29.853 130.607 46.0 6.2 place \ time 1955-07-27 01:20:53 Shikoku;Japan 1954-04-13 15:25:42 Shikoku;Japan 1952-05-22 23:08:21 southeast of the Ryukyu Islands;Japan 1951-10-15 21:02:01 Shikoku;Japan 1951-06-05 16:57:45 southeast of the Ryukyu Islands;Japan 1950-12-05 21:53:38 southeast of the Ryukyu Islands;Japan 1950-11-05 17:37:33 Shikoku;Japan 1950-05-31 13:13:14 Ryukyu Islands;Japan point \ time 1955-07-27 01:20:53 33 45m 57.6s N, 134 18m 36s E 1954-04-13 15:25:42 32 55m 4.8s N, 134 20m 45.6s E 1952-05-22 23:08:21 29 48m 50.4s N, 131 12m 28.8s E 1951-10-15 21:02:01 32 51m 46.8s N, 134 24m 14.4s E 1951-06-05 16:57:45 29 47m 45.6s N, 131 18m 14.4s E 1950-12-05 21:53:38 29 46m 12s N, 131 11m 60s E 1950-11-05 17:37:33 33 30m 14.4s N, 134 45m 14.4s E 1950-05-31 13:13:14 29 51m 10.8s N, 130 36m 25.2s E ref_point distance_km year \ time 1955-07-27 01:20:53 32 53m 2.4s N, 131 6m 14.4s E 314.110034 1955 1954-04-13 15:25:42 32 53m 2.4s N, 131 6m 14.4s E 303.324719 1954 1952-05-22 23:08:21 32 53m 2.4s N, 131 6m 14.4s E 340.531862 1952 1951-10-15 21:02:01 32 53m 2.4s N, 131 6m 14.4s E 308.831142 1951 1951-06-05 16:57:45 32 53m 2.4s N, 131 6m 14.4s E 342.911723 1951 1950-12-05 21:53:38 32 53m 2.4s N, 131 6m 14.4s E 345.386279 1950 1950-11-05 17:37:33 32 53m 2.4s N, 131 6m 14.4s E 347.211844 1950 1950-05-31 13:13:14 32 53m 2.4s N, 131 6m 14.4s E 339.373185 1950 Date Year time 1955-07-27 01:20:53 1955-07-27 01:20:53 1955 1954-04-13 15:25:42 1954-04-13 15:25:42 1954 1952-05-22 23:08:21 1952-05-22 23:08:21 1952 1951-10-15 21:02:01 1951-10-15 21:02:01 1951 1951-06-05 16:57:45 1951-06-05 16:57:45 1951 1950-12-05 21:53:38 1950-12-05 21:53:38 1950 1950-11-05 17:37:33 1950-11-05 17:37:33 1950 1950-05-31 13:13:14 1950-05-31 13:13:14 1950
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/12/03 14:40
2020/12/03 14:44
2020/12/03 14:48
2020/12/03 14:53
2020/12/03 15:04
2020/12/03 15:23