matlab_kernel
matlab_kernel copied to clipboard
Dose it supports inline vector graph
I have tried %plot --format=svg
, but it seems not work.
I get this error
Error in calling magic 'plot' on line:
'MatlabKernel' object has no attribute '_validated_plot_settings'
args: []
kwargs: {'height': None, 'width': None, 'resolution': None, 'backend': 'inline', 'format': 'svg', 'size': None}
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.7/site-packages/metakernel/magic.py", line 94, in call_magic
func(*args, **kwargs)
File "/opt/anaconda3/lib/python3.7/site-packages/metakernel/magics/plot_magic.py", line 58, in line_plot
self.kernel.handle_plot_settings()
File "/opt/anaconda3/lib/python3.7/site-packages/matlab_kernel/kernel.py", line 192, in handle_plot_settings
settings = self._validated_plot_settings
AttributeError: 'MatlabKernel' object has no attribute '_validated_plot_settings'
%plot [options] backend - configure plotting for the session.
This line magic will configure the plot settings for this
language.
Examples:
%plot qt --format=png
%plot inline -w 640
Note: not all languages may support the %plot magic, and not all
options may be supported.
Options:
-------
-h --height Plot height in pixels
-w --width Plot width in pixels
-r --resolution Resolution in pixels per inch
-b --backend Backend selection [default: inline]
-f --format Plot format (png, svg or jpg).
-s --size Pixel size of plots, "width,height"
as @jdtuck showed, there is no option to use an inline-vector graph.
instead of that, I'm using Plotly in offline mode. https://plotly.com/matlab/offline/
This won't produce graphs inline but in HTML file. But, with Jupyter lab, it supports opening HTML files in tabs, so very helpful for me to see graphs interactively.
Bumping the previous PR here #157 since it should directly address this issue.