How to display images when using for loop in IJulia? - julia

i want to display images in Jupyter using Image.jl.
the doc says:
If you're using the IJulia notebook, images will be displayed automatically.
Julia code for the display of images can be found in ImageView. Installation of this package is recommended but not required.
but i failed to find any way to automatically display images in a for loop. the code below is an example:
using Images
for i=1:10
convert(Image,rand(100,100))
end
i guess there exits an undocumented function to draw images in IJulia which can be called explicitly to show out those hidden results. thanks in advance! #tholy

You need to use the display function, which is what IJulia uses, you can find it's documentation in the Multimedia I/O section of the Julia manual.

Related

How to get a screenshot directly into a variable when using R

I use R and the Magick package to process screenshots! Currently, I'm going through an external tool to get my screenshots. This tool gives me a file (png or other) that I have to reload to use it with Magick. Is there a package that would allow me to take screenshots (in whole or only partially) and to retrieve the image directly into a variable without going through an intermediate file? I found plenty of stuff for web-snapshots but nothing for a capture of my screen...
Thanks in advance

Octave in Jupyter Notebook - Opening 3D plot in an external window for interactive use

Is it possible using Octave in Jupyter Notebook to open plots in an external window so that they can be manipulated (zooming in/out, rotating)?
I hoped there would be some switch so that I could use them inline (as it is by default) but if need be, I could open them in an external window to manipulate it the way like in GNU Octave GUI. After checking what I need, I would switch back to inline.
I looked for some hints. I found this %%octave -g in octavemagic: Octave inside IPython. Unforutunately, it doesn't work for me when using Octave kernel.
I found something about inline plotting in An Octave kernel for Jupyter (Configuration section) but it doesn't look like it could help anything in regard to switching on/off it from the notebook.
For example, I would like the following code to invoke an external window.
y=-10:0.4:10+eps;
[xx,yy]=meshgrid(x,y);
zz= sin(sqrt(xx.^2+yy.^2))./(sqrt(xx.^2+yy.^2));
surf(xx,yy,zz)
view(-35,45)
It looks like that I have finally found the answer here:
https://github.com/Calysto/octave_kernel/issues/98
https://github.com/Calysto/octave_kernel/issues/6
https://am111.readthedocs.io/en/latest/jmatlab_use.html
%plot gnuplot - switch to using external window
%plot inline - switch to using inline plotting

Setting up R in Atom: How to Run a Help Page

I successfully set up R in my new Atom editor and can get in-line results using the Hydrogen package. I just noticed, however, that when I run lines to obtain "R Documentation" that would pop up automatically in RStudio, Hydrogen only gives me a check mark in-line result with no associated documentation.
Here is what is going on in my Atom editor when I run ?plot
Here is what happens in RStudio (bottom right pane), which I am hoping I can get in Atom
How can I get this working in Atom?
try hydrogen -> Toggle inspector
I had the same question and actually made a little progress. Perhaps someone more experienced than I can use this to make a package to enable an in-atom help documentation panel for us :)
Anyway you can install the atom package 'script' which will properly output some, but not all, help documents. I have an example of one working & one not working.
Working ?read.csv
Not-working ?geom_bar

Atom editor: list and jump to definition(s) in project

As already mentioned I'm using the Atom text editor.
I'm currently working on a project written in c++. Of course it is desirable to jump to the definition of a function (in another project file), or other uses of this function (within the project). As far as I know this can be achieved with the packages I'll mention below. I want the package to display me the definition along with the path to the corresponding file which holds the definition and ideally the line where it occurs.
I'll welcome any comments and suggestions on how to solve the below mentioned problem(s) I have with (one of) the packages. Moreover I'm also thankful about pointers to possible solutions or posts concerning my problem(s), or how I can achieve this with another package.
Here is what I found / tried / did so far.
goto
Currently I'm using this package, although it is rather slow and does not show the arguments of the function as e.g. atom-ctags does, but it's the only package which displays me the files I need to see.
It shows me where the function is defined as well as where it is also used. However it does not show me the path to the file corresponding file it refers to.
atom-ctags
I also tried this package, building the tags is quite fast and moreover it show me the path to the file. But this package only lists the .cc files and not the .h files. It appears to me as if it only shows me the other uses but not the definition, which is obviously a problem.
I also tried generating the ctags myself and changing the command options in the settings of the package, unfortunately without any success.
Atoms built-in symbols-view
In order to get this to work, one needs to generate the symbols. This can be, for example, achieved with the symbol-gen package. However, it shows me some of the definitions, but also no .h files. Moreover, jumping to the definition results in a Selected file does not exist., therefore it is not usable at all.
goto-definition
Just for completeness, there is also this package. It does not work for me, since c++ is not supported but maybe others will find it useful.
symbols-plus
Again, for completeness, this should be a replacement for the atom built-in, but when disabling the build-in it does not show me any jump functionality nor is a short cut mentioned.
So, basically, nothing really works well. I have tried Symbol Tree View but it but barely works.

Display IFrame in IJulia Jupyter Notebook

Is there a way to display an IFrame in an IJulia Jupyter notebook?
I am trying to use Plotly.jl with Jupyter. When plot is called it returns a URL linking to the generated graph.
Using an IFrame should allow this to work out.
Plotly.plot(["z"=>rand(6,6)],["style"=>["type"=>"heatmap"]])
https://plot.ly/~astrieanna/0 # Returned URL
This is not an answer the the posted question, but it does solve the issue with plotly.
Plotly.jl is about to undergo massive changes. One of these will be relying on the PlotlyJS.jl package for all plot generation and display.
If you want to use plotly from julia in a jupyter notebook you should use PlotlyJS.jl: https://github.com/spencerlyon2/PlotlyJS.jl
Docs here: http://spencerlyon.com/PlotlyJS.jl/
IJuliaPortrayals has an IFrame constructor.
IFrame(600, 200, "http://julialang.org")
At In [15]:
Bring back 2003-era pages with IFrame!

Resources