python - 在pyplot中的乳胶代码中迭代格式化值
问题描述
抱歉,如果已经问过这个问题,但我找不到任何相关信息。在 pyplot 中,我想知道是否可以在一段乳胶代码中从 for 循环中格式化值?例如,我希望使用类似的东西
import matplotlib.pyplot as plt
for k in range(len(b)):
plt.plot(a, b)
plt.ylabel(r'$\sqrt{| R(a, {}) |}$'.format(k))
plt.close()
这将返回 sqrt(| R(a, 1) |)、sqrt(| R(a, 1) |) 等作为每张新图片上的乳胶形式的 y 标签。
解决方案
推荐阅读
- salesforce - 使用赛普拉斯测试自动化,用于使用 Salesforce 构建的网站
- python - 当旧线程死亡时重新启动函数
- python - 对于大小为 1 的轴 1,索引 6 超出范围
- google-sheets - 谷歌表格:在一行中查找最后一个非空单元格并从不同行中提取单元格值
- html - 如何根据其宽度制作表格单元格内容文本?
- reactjs - 我正在尝试验证我的电子邮件,如果输入我可以验证电子邮件,但如果粘贴电子邮件,我的电子邮件验证失败
- java - 如何在 Flutter 中显示默认锁定屏幕而不是我的启动器应用程序?
- ios - Readium 库第二页单词 hi-lighter 在 ios 的横向中不起作用
- excel-formula - Coda 文档如何通过匹配 id 来获取值
- c# - 删除 Excel 中的组合框并尝试使用 VSTO 插件保存工作簿时 Excel 崩溃