-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error plotting with Octave 6.1.0 on jupyter notebook #183
Comments
Adding |
I saw this answer over on StackOverflow but you can add the command
to the beginning of your script to make it work. Does anyone know how to add this to the kernel? |
Looks like that is set in the config settings "backend": https:/Calysto/octave_kernel/blob/master/octave_kernel/kernel.py#L215 https:/Calysto/octave_kernel#configuration So:
|
Quite peculiar, See following comparison (Jupyter Lab, WinPython, Win10): octave 6.2.0version()
graphics_toolkit()
loaded_graphics_toolkits()
plot(1:10)
fig = figure()
h = plot(1:10);
xlabel('\varphi') % additional indicator: \varphi is not suported in fltk, but it is in gnuplot
set(fig,'Visible','on')
toolkit = get(fig,"__graphics_toolkit__")
(plot is shown, xlabel reads verbatim graphics_toolkit("gnuplot") loaded_graphics_toolkits()
fig2 = figure()
h = plot(1:10);
xlabel('\varphi')
toolkit = get(fig2,"__graphics_toolkit__")
(plot is shown, xlabel shows correct symbol) octave 5.2.0version()
graphics_toolkit()
loaded_graphics_toolkits()
fig2 = figure()
h = plot(1:10);
xlabel('\varphi')
get(fig2,"__graphics_toolkit__")
(plot is shown, xlabel shows correct symbol) graphics_toolkit("fltk") loaded_graphics_toolkits()
fig = figure()
h = plot(1:10);
xlabel('\varphi') % additional indicator: \varphi is not suported in fltk, but it is in gnuplot
set(fig,'Visible','on')
toolkit = get(fig,"__graphics_toolkit__")
(plot is shown, xlabel reads verbatim fig = figure()
h = plot(1:10);
xlabel('\varphi') % additional indicator: \varphi is not suported in fltk, but it is in gnuplot
% setting 'Visible' to 'on' omitted
toolkit = get(fig,"__graphics_toolkit__")
Even though octave bug report 60095 looks kind of related, this is not reproducible with octave-cli.exe (v6.2.0) nor octave-gui.exe. |
Okey I now moved on to Octave 6.3.0 but the problem persists, a solution is as @lukkesweet has mentioned putting on every script
I wanted to evade doing this all the time by putting
in a octave_kernel_config.py located at /.jupyer as @dsblank suggested but then the notebook doesn't print anything despite not sending any errors. Octave 4.4.1 didn't have this plotting related problems, someone knows if notebooks made with the kernel pointing to 4.4.1 would later be usable if oppened but with the kernel pointing to another version of Octave? |
I have installed two versions of Octave both 32 bits.
*I also have gnuplot 5.2 patch level 7 installed-
The octave kernel is installed in anaconda via:
conda install octave_kernel
OCTAVE_EXECUTABLE
C:\\Octave\\Octave-4.4.1\\bin\\octave-cli.exe
once it's up and running, the jupyter notebook loads the kernel and i run the example:
resultant plotting from the code above
If I check the graphic toolkits that display the plots with the commands i get:
available_graphics_toolkits()
And the current toolkit is:
loaded_graphics_toolkits ()
BUT if i change the enviromental variable to point to the Octave-6.1.0 executable with:
C:\\Octave\\Octave-6.1.0\\mingw32\\bin\\octave-cli.exe
once i run the chunks of code, the ones with calculations are doing fine
for example, if i take the
;
off the zz variable you get the matrix printed on the outputbut the plot block of code
sends as output the error:
Which tells me there is somwthing between jupyter kernel and Octave 6.1.0, maybe Octave handles graphics in a new way?.
I know Octave 6.1.0 is working because the same code produces the correct plot if you run it directly in the octave application gui or cli.
plot window of the same graph captured from the Octave-gui application
The octave kernel says it's working if I check it with the command
python -m octave_kernel.check
The check reveals:
when trying to plot in the jupyter notebook the console keeps sending a similar error
That seems to be also affiliated with accessing the magic.py file in the metakernel package, when plotting.
The text was updated successfully, but these errors were encountered: