nschloe/matlab2tikz — pull request #316 by drgz (2014-02-12 12:30:50+00:00)
Title: Small bug in scatterplot with dot-marker + scaling changed again

Sorry to drag this up again; I see you have changed it to ``sData = sqrt(sData/pi)`` in the most up to date version. This scaling is incorrect (if it was correct, it would only apply to circular marker types). Did some more tests now, and if you're satisfied with how markers are handled for regular line plots, etc, the best approximation to that is the following;

```
sData = sqrt(sData);
[sData, dummy] = translateMarkerSize(m2t, matlabMarker, sData); % must use matlabMarker here to avoid errors in translateMarkerSize as translateMarker changes e.g., 'pentagram' to 'star', which isn't recognized by translateMarkerSize
```

Try yourself with the following code for different types of markers.

```
n = 1:100;
s = 1000*rand(length(n),1);
figure;
P = scatter(n,n,s,n.^8,'x');
box on;
grid on;
matlab2tikz('scatter.tex','standalone',true);
figure;
hold on;
for k = 1:100
plot(n(k),n(k),'x','MarkerSize',sqrt(s(k)));
end
box on;
grid on;
matlab2tikz('marker_lineplot.tex','standalone',true);
```

You will see that with the present code, there will be a **huge** difference between the two compiled outputs, whereas with the suggested code above they will be almost identical. This applies to all regular marker types.

The compiled output with this code will differ slightly more from the reference rending of ``matlab2tikz_acidtest(60)`` than the present code. I'm not sure what the best solution to that "problem" is, but if it is a problem, then it also applies to the handling of regular markers in line plots as the compiled output of the above code for scatter group plots, and regular line plots with markers are nearly identical. One solution may be to adjust the code in the ``translateMarkerSize`` function; in that way it will apply to both scatter group plots and regular line plots with markers.

During the tests I also discovered that one needs an additional if-test to handle the case of dot-markers as they don't have any ``faceColor``, yet they are filled with ``markerEdgeColor``.