2
votes

I need to draw a scatter-plot with semitransparent filled markers. As an example I need to set alpha color on the filled markers in the following code.

I'm using graphics_toolkit('gnuplot') and Octave 4.0.3 on Debian 9 Stretch.

I know that in Matlab is possible to modify the transparency of the markers on the scatter plots. I need to have the same in Octave 4.0.3

clf
h=figure(1);

n = 100;
x = randn(n, 1);
y = randn(n, 1);
S = rand(n, 1)*50;
hold on
s1=scatter(x(1:50), y(1:50), S(1:50), 'red', "filled")
s2=scatter(x(51:100), y(51:100), S(51:100), "green", "filled")

set(s1,'edgecolor','none');
set(s1,'facealpha',0.2);
set(s2,'edgecolor','none');
set(s2,'facealpha',0.2);

this code produces the following figure.

hold off
saveas(h, 'bubbleplot.png');

example bubbleplot

1
Please add a MCVE, you above snippet can't be run beause s1 is undefined. ALso add used graphics_toolkit and GNU Octave version - Andy
Thank you I added the info in the post. I'm using graphics_toolkit('gnuplot') on Debian 9 stretch - jolinar35

1 Answers

0
votes

I'm afraid you are out of luck. Octave (even as of 5.1.0) only supports alpha transparency for patch and surface plots, not for markers in scatter or line plots.

You can submit a GNU Octave bug report requesting support for this.