Question

I have a samples list with a collection of (x,y) coordinates pairs. I want to use plot2d to create a discrete plot from these points, not showing lines connecting each point.

This is my script:

plot2d(
  [discrete, samples],
  [style, [points, 1, 5, 1]],
  [legend, "Samples"],
  [gnuplot_term, "svg size 640,480"],
  [gnuplot_out_file, "graph_samples.svg"]
)$

But the result is a plot with connected points, as can be seen in the picture below. Despite the use of the [style, [points, 1, 5, 1]] option, the plot connects each point. The style definition seems to be ignored.

Samples Plot

Does anyone have a clue why is this happening? I know I could alternatively use draw2d but I'd rather use plot2d if possible.

Was it helpful?

Solution 2

The problem was that I had a points matrix previously declared that was conflicting with the style definition. Changed its name and worked like a charm.

OTHER TIPS

You can also quote a symbol to prevent evaluation:

points: [1, 2, 3];
x: 42;
plot2d('x^2, ['x, 1, 2], ['style, 'points]);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top