2

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.

2 Answers 2

4

You can also quote a symbol to prevent evaluation:

points: [1, 2, 3];
x: 42;
plot2d('x^2, ['x, 1, 2], ['style, 'points]);
Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.