How do I publish figures as a pdf so that it shows as it does in MATLAB?

% SIMPLE_PLOT Generate a plot with x and y values as a black line, with labels and a title.
x = linspace(0,2*pi,200);
y = sin(x); % example y values
figure(1)
plot(x,y,’k-‘)
xlabel(‘x (radians)’)
ylabel(‘sin(x)’)
title(‘Black Line: Sine Wave’)
grid on
So as you can see when i run this code in MATLAB it runs and outputs corrrectly but when i go to publish it I am left with it looking like this in the Publish_Example.pdf below.

If you could give me any suggestions or solutions on how to fix this problem it would be greatly appreciated. Thank you!% SIMPLE_PLOT Generate a plot with x and y values as a black line, with labels and a title.
x = linspace(0,2*pi,200);
y = sin(x); % example y values
figure(1)
plot(x,y,’k-‘)
xlabel(‘x (radians)’)
ylabel(‘sin(x)’)
title(‘Black Line: Sine Wave’)
grid on
So as you can see when i run this code in MATLAB it runs and outputs corrrectly but when i go to publish it I am left with it looking like this in the Publish_Example.pdf below.

If you could give me any suggestions or solutions on how to fix this problem it would be greatly appreciated. Thank you! % SIMPLE_PLOT Generate a plot with x and y values as a black line, with labels and a title.
x = linspace(0,2*pi,200);
y = sin(x); % example y values
figure(1)
plot(x,y,’k-‘)
xlabel(‘x (radians)’)
ylabel(‘sin(x)’)
title(‘Black Line: Sine Wave’)
grid on
So as you can see when i run this code in MATLAB it runs and outputs corrrectly but when i go to publish it I am left with it looking like this in the Publish_Example.pdf below.

If you could give me any suggestions or solutions on how to fix this problem it would be greatly appreciated. Thank you! publish, figure, pdf MATLAB Answers — New Questions

​

Leave a Reply

Your email address will not be published. Required fields are marked *