简体   繁体   English

如何使用 PyPlot 和 Julia 在 Atom/Juno 中自动显示交互式绘图

[英]How to display automatically interactive plots in Atom/Juno using PyPlot and Julia

I'm using Atom/Juno as IDE for my Julia programming.我使用 Atom/Juno 作为 IDE 进行 Julia 编程。 I use PyPlot for graphical representation of plots however I noticed two important aspects (I'm migrating from MATLAB)我使用PyPlot进行绘图的图形表示,但是我注意到两个重要方面(我正在从 MATLAB 迁移)

1- figures do not appear automatically after running julia scripts but only after typing PyPlot.display_figs() in the REPL . 1- 图形在运行 julia 脚本后不会自动出现,但只有在REPL中键入PyPlot.display_figs()后才会出现。

2- figures displayed in Atom are not interactive. 2- 显示在 Atom 中的数字不是交互式的。

On the contrary, if I open Julia REPL from terminal and I run the same code an interactive window appears (only after typing PyPlot.display_figs() ).相反,如果我从终端打开 Julia REPL并运行相同的代码,则会出现交互式 window (仅在键入PyPlot.display_figs()之后)。 Can I use Atom and have interactive plots to appear automatically at the end of each script without everytime using the REPL ?我可以使用 Atom 并让交互式绘图自动出现在每个脚本的末尾,而无需每次都使用REPL吗?

You have two options:你有两个选择:

  1. Disable in built Atom plot Pane禁用内置 Atom plot 窗格
  2. Use interactive plotting backend (plotlyjs could be the best option)使用交互式绘图后端(plotlyjs 可能是最好的选择)

Ad.1.广告1。

Go in Atom to Seetings->Packages->Julia Client->UI Options and disable the "Enable plot pane" option. Go 在 Atom 到 Seetings->Packages->Julia Client->UI 选项并禁用“启用 plot 窗格”选项。 Restart Atom.重启原子。

Ad.2.广告2。

With the "Enable plot pane" turned on try running this code:打开“启用 plot 窗格”后,尝试运行以下代码:

using Plots
plotlyjs()
Plots.plot(sin.(0:0.1:7))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM