matlab_kernel icon indicating copy to clipboard operation
matlab_kernel copied to clipboard

Dose it supports inline vector graph

Open Behemoth-s opened this issue 5 years ago • 3 comments

I have tried %plot --format=svg , but it seems not work.

Behemoth-s avatar Mar 04 '19 01:03 Behemoth-s

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"

jdtuck avatar Nov 16 '19 17:11 jdtuck

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.

YutaKudo avatar Nov 01 '20 10:11 YutaKudo

Bumping the previous PR here #157 since it should directly address this issue.

TK-21st avatar Sep 29 '21 13:09 TK-21st