1

I'm playing around with trying to create a Box and Whisker plot with gnuplot, to output into a latex document. I keep having the following error:

"test.gp", line 10: undefined variable: using

My code is below:

set terminal latex
set output "test.tex"
set style data boxplot
set style fill solid 0.25 border -1
set style boxplot outliers pointtype 7

set datafile separator ","
set xrange[0:6] 
set yrange[0.000:1.000] 
plot "test.csv" using 1:3:2:6:5:xticlabels(7) with candlesticks notitle whiskerbars, using 1:4:4:4:4 with candlesticks lt -1 notitle

And here is the CSV file that I'm using:

1,0.381768,0.386109,0.423836,0.381768,0.42965,"0.3", 2,0.400131,0.446271,0.47671,0.400131,0.481733,"0.4", 3,0.442295,0.443961,0.512071,0.442295,0.58654,"0.5", 4,0.464072,0.502773,0.516437,0.464072,0.589175,"0.6", 5,0.460358,0.468294,0.479633,0.460358,0.562291,"0.7",

Is anybody able to help me figure out what's wrong

5
  • BTW are you interested in plotting the candlesticks or boxplots? Commented Jun 13, 2014 at 19:51
  • What's the difference? I've mainly been following examples I found online and they use candlesticks. Commented Jun 14, 2014 at 11:56
  • 2
    Well, with boxplots you just specify your column of data and the mean, stdev will be calculated. You also have the options to show outliers in different styles. Whereas with candlesticks you explicitly need to specify the five point summary i.e. min, 25%ile, median, 75%ile and max. So if you are just planning to get candlesticks, which is also evident from your data then set style data boxplot and set style boxplot outliers pointtype 7 are not needed. Commented Jun 14, 2014 at 14:53
  • 1
    Also look at these links for examples: gnuplot.sourceforge.net/demo_canvas/boxplot.html and gnuplot.sourceforge.net/demo/candlesticks.html Commented Jun 14, 2014 at 14:53
  • Thanks, wish I knew that before I wrote the code to calculate it all, lol. Commented Jun 14, 2014 at 15:05

1 Answer 1

2

In your plot command, you are missing the second '',Try this:

plot "test.csv" using 1:3:2:6:5:xticlabels(7) with candlesticks notitle whiskerbars, '' using 1:4:4:4:4 with candlesticks lt -1 notitle
Sign up to request clarification or add additional context in comments.

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.