gnuplotrb icon indicating copy to clipboard operation
gnuplotrb copied to clipboard

Scatterplot in Dataframe

Open lokeshh opened this issue 9 years ago • 3 comments

I'm trying to draw scatter plot of the following dataframe but it misses some points.

df = Daru::DataFrame.new({
  x: [3, 3, 3],
  y: [1, 2, 3]
  }, index: [0, 2, 3])
Plot.new [df, pt: 6, ps: 1, using: '2:3']

Although if I do not specify any index then it works pretty well.

lokeshh avatar Jun 23 '16 15:06 lokeshh

BTW, I'm not sure what using option does? Could someone tell me or point in the direction where I can read about it. Thanks

lokeshh avatar Jun 23 '16 16:06 lokeshh

You may take a look at the option description in Gnuplot doc (http://www.gnuplot.info/docs_5.0/gnuplot.pdf , p.91).

In your case it tells Gnuplot to use 2-nd (as x) and 3-rd (as y) columns (1-st column is index, 2-nd is x and 3-rd is y for you datasheet) to plot you graph.

Please attach graphs, you're getting as a result in both cases.

ievgrafov avatar Jun 25 '16 12:06 ievgrafov

Here's the image when I set a index different than default: wrong and here's the image when I use the default index: right

lokeshh avatar Jun 26 '16 06:06 lokeshh