논문 서치중에 일본어로 된 논문 있길래(못읽음) 들어가서 구경해봤는데 플롯 색깔이 파스텔톤으로 되게 예쁘네
이거 matplotlib으로 그린걸까?
matplotlib에서 cmap만 파스텔톤으로 설정한거아닐까
컬러바 색깔이 (0, 0, 0)이 아니고 테두리도 굵은 것 같은데 이것도 조정 가능?
존나 예쁘네 ㅋㄱ
ㄹㅇ 지렸다 이것이 일본의 미적감각...?
import numpy as npimport matplotlib.pyplot as pltimport matplotlib.colors as mcolorsx = np.linspace(0, 6, 200)y = np.linspace(0, 6, 200)X, Y = np.meshgrid(x, y)Z1 = np.sin(X) * np.cos(Y)Z2 = np.sin(3*X) - np.cos(3*Y)Z3 = Z1 + Z2
colors1 = ["#FFB3BA", "#FFDFBA", "#FFFFBA", "#BAFFC9", "#BAE1FF"] colors2 = ["#B3CDE3", "#CCEBC5", "#DECBE4", "#FED9A6", "#FFFFCC"] colors3 = ["#FBB4AE", "#B3CDE3", "#CCEBC5", "#DECBE4", "#FED9A6", "#FFFFCC"] cmap1 = mcolors.ListedColormap(colors1) cmap2 = mcolors.ListedColormap(colors2) cmap3 = mcolors.ListedColormap(colors3) num_levels = 6
def plot_discrete_contour(ax, X, Y, Z, title, cmap, num_levels): levels = np.linspace(Z.min(), Z.max(), num_levels) cont = ax.contourf(X, Y, Z, levels=levels, cmap=cmap, extend='both') ax.set_title(title) ax.set_xlabel('$x_1$') ax.set_ylabel('$x_2$') plt.colorbar(cont, ax=ax, ticks=levels, spacing='uniform') fig, axes = plt.subplots(1, 3, figsize=(15, 5))
plot_discrete_contour(axes[0], X, Y, Z1, '(a) ', cmap1, num_levels)plot_discrete_contour(axes[1], X, Y, Z2, '(b) ', cmap2, num_levels)plot_discrete_contour(axes[2], X, Y, Z3, '(c) ', cmap3, num_levels)highlight_point = (5, 4) for ax in axes: ax.plot(*highlight_point, 'w*', markersize=10) plt.tight_layout()plt.subplots_adjust(top=0.85) plt.show()
오 비슷하게 파스텔톤으로 나오네 쌉고수님 ㄱㅅ요
챗지피티에 저 그림넣고 코드짜달라니까 이렇게 짜줌ㅋㅋ
matplotlib에서 cmap만 파스텔톤으로 설정한거아닐까
컬러바 색깔이 (0, 0, 0)이 아니고 테두리도 굵은 것 같은데 이것도 조정 가능?
존나 예쁘네 ㅋㄱ
ㄹㅇ 지렸다 이것이 일본의 미적감각...?
import numpy as npimport matplotlib.pyplot as pltimport matplotlib.colors as mcolorsx = np.linspace(0, 6, 200)y = np.linspace(0, 6, 200)X, Y = np.meshgrid(x, y)Z1 = np.sin(X) * np.cos(Y)Z2 = np.sin(3*X) - np.cos(3*Y)Z3 = Z1 + Z2
colors1 = ["#FFB3BA", "#FFDFBA", "#FFFFBA", "#BAFFC9", "#BAE1FF"] colors2 = ["#B3CDE3", "#CCEBC5", "#DECBE4", "#FED9A6", "#FFFFCC"] colors3 = ["#FBB4AE", "#B3CDE3", "#CCEBC5", "#DECBE4", "#FED9A6", "#FFFFCC"] cmap1 = mcolors.ListedColormap(colors1) cmap2 = mcolors.ListedColormap(colors2) cmap3 = mcolors.ListedColormap(colors3) num_levels = 6
def plot_discrete_contour(ax, X, Y, Z, title, cmap, num_levels): levels = np.linspace(Z.min(), Z.max(), num_levels) cont = ax.contourf(X, Y, Z, levels=levels, cmap=cmap, extend='both') ax.set_title(title) ax.set_xlabel('$x_1$') ax.set_ylabel('$x_2$') plt.colorbar(cont, ax=ax, ticks=levels, spacing='uniform') fig, axes = plt.subplots(1, 3, figsize=(15, 5))
plot_discrete_contour(axes[0], X, Y, Z1, '(a) ', cmap1, num_levels)plot_discrete_contour(axes[1], X, Y, Z2, '(b) ', cmap2, num_levels)plot_discrete_contour(axes[2], X, Y, Z3, '(c) ', cmap3, num_levels)highlight_point = (5, 4) for ax in axes: ax.plot(*highlight_point, 'w*', markersize=10) plt.tight_layout()plt.subplots_adjust(top=0.85) plt.show()
오 비슷하게 파스텔톤으로 나오네 쌉고수님 ㄱㅅ요
챗지피티에 저 그림넣고 코드짜달라니까 이렇게 짜줌ㅋㅋ