python - Seaborn 联合图+散点图未显示完整网格
问题描述
我正在使用 seaborn joinplot和scatterplot来生成这种类型的图:
我的问题是没有显示完整的网格。我已经标记了缺失的部分(应该作为边框)。
编码:
df1 = pd.DataFrame({'col1': X, 'col2':Y})
df2 = pd.DataFrame({'col1': X_main_map, 'col2':Y_main_map})
graph = sns.jointplot(data = df1,x="col1", y="col2",kind="scatter",s=2,color='darkred',marginal_kws={"bins":100,"color":"darkred"},marginal_ticks = True)
graph2 = sns.scatterplot(data = df2, x = "col1",y="col2", s=1,ax=graph.ax_joint)
graph2.set(xticklabels=[])
graph2.set(xlabel=None)
graph2.tick_params(left=False) # remove the ticks
graph2.set(yticklabels=[])
graph2.set(ylabel=None)
graph2.tick_params(bottom=False) # remove the ticks
graph2.set(ylim=(-12,20),xlim=(-10,13))
解决方案
推荐阅读
- flutter - 等待完成后如何关闭警报对话框
- swift - 在 Swift Dictionary 中调用嵌套超过 1 层的项目
- awk - 从现有行 bash 创建新行
- reactjs - 如何在 React Js Cordova 中调用短信 IOS 和 Android 应用程序?
- flutter - 在不阻止其他小部件的点击检测的情况下检测点击
- c++ - 如何获得 glm::mat4 的镜面反射?
- java - 数据库添加自动生成的标签列以提高可搜索性
- ruby - 在 Ruby 中解析并转换为 CSV 文件的哈希返回一个整数
- python - python 多处理映射中的 PID 是否保证相对于可迭代对象具有递增顺序?
- javascript - angular-12 中 $event 的类型是什么