0

The following code:

data = rand(4, 5);

figure
h4 = bar(data, "stacked", "linestyle", "none");
l4 = legend("Col1", "Col2", "Col3", "Col4", "Col5");
legend(l4, "location", "northeastoutside");

produces a plot that has no lines around the rectangles, as can be seen in the following screenshot: enter image description here

However, when saved, be it via the menu or programmatically, the borders appear: enter image description here

This happens when saving as PNG, EPS or PDF. Am I missing some option to generate the boxes without the border?

Thanks in advance,

Rodrigo

Rodrigo Morante
  • 103
  • 1
  • 2
  • 6

1 Answers1

0
clear all; close all; clc;
data = rand(4, 5);
figure
h4 = bar(data, "stacked", "linestyle", "none");
l4 = legend("Col1", "Col2", "Col3", "Col4", "Col5");
h=legend(l4, "location", "northeastoutside");
axis off;