8000 Plot with left and right Y-axes in a mlx fails to export to eps in Live script · Issue #387 · altmany/export_fig · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Plot with left and right Y-axes in a mlx fails to export to eps in Live script #387

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

Open
Patrik112358 opened this issue Feb 29, 2024 · 1 comment

Comments

@Patrik112358
Copy link

Hello, I'm running version 3.44 and I stumbled upon a problem when trying to export a figure with a plot using left & right yyaxis. While trying to come up with a minimal working (failing) example, I have discovered that this problem only seems to happen in Live scripts (.mlx). The exported figure is empty and the following warning is emitted:

Warning: Some uifigure controls cannot be exported by export_fig and will not appear in the generated output .

Same code in .m file produces figure normally.

t = linspace(0,10);
x = sin(t);
y = cos(t);

f = figure;

yyaxis left
pleft = plot(t, x, '-');

yyaxis right
pright = plot(t, y, '-');

export_fig(f, 'tryout', '-eps');

I'm not very well versed in Matlab, so if you need some more info to replicate this, I'll gladly try to provide.

@altmany
Copy link
Owner
altmany commented May 2, 2024

There is a built-in limitation of Matlab that causes plots with multiple Y axes (created using the yyaxis function) to be exportable only if they are created in a standalone script or non-web-based figure, not in a Live Script or a live figure.
Reference: https://www.mathworks.com/help/matlab/ref/copyobj.html#bugxv3a_div

altmany added a commit that referenced this issue May 2, 2024
…rted (issue #387); fixed contour labels with non-default FontName incorrectly exported as Courier (issue #388)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0