0

I have the following data:

ora_data01      484     484     486     490     620
ora_data02      650     651     651     671     741
ora_data03      730     768     769     773     773
ora_data04      525     525     525     541     605
ora_data05      472     547     559     635     643
ora_data06      285     377     404     494     609
ora_data07      267     353     387     453     585
ora_data08      308     434     469     526     581
local_backup    118     442     147     156     136

and I want to create a histogram chart, and I wrote the following script:

set terminal png truecolor
set output "moneta_FS.png"
set grid
set style data histograms
set style fill solid 1.00 border -1
plot "moneta_fs_2014.txt" using 2:xtic(1) title "Jan-14 data growth(Gb)", "moneta_fs_2014.txt" using 5 title "Feb-14 data growth(Gb)",
'' using 6 title "Mar-14 data growth(Gb)", '' using 7 title "Apr-14 data growth(Gb)", '' using 8 title "May-14 data growth(Gb)"

and is giving me the following error:

gnuplot> plot "moneta_fs_2014.txt" using 2:xtic(1) title "Jan-14 data growth(Gb)", "moneta_fs_2014.txt" using 5 title "Feb-14 data growth(Gb)",
                                                                                                                                               ^
         line 0: function to plot expected

gnuplot> '' using 6 title "Mar-14 data growth(Gb)", '' using 7 title "Apr-14 data growth(Gb)", '' using 8 title "May-14 data growth(Gb)"
         ^
         line 0: invalid command

1 Answer 1

1

If that is your actual script, you have a line formatting problem here:

plot "moneta_fs_2014.txt" using 2:xtic(1) title "Jan-14 data growth(Gb)", "moneta_fs_2014.txt" using 5 title "Feb-14 data growth(Gb)",
'' using 6 title "Mar-14 data growth(Gb)", '' using 7 title "Apr-14 data growth(Gb)", '' using 8 title "May-14 data growth(Gb)"

The first line of the plot command ends with a carriage return, which is the command delimiter, and thus GNUPlot has no idea what to do with the second line. You can either (a) merge these into a single line, or (b) use backslashes (\) to spread your command over multiple lines:

plot "moneta_fs_2014.txt" using 2:xtic(1) title "Jan-14 data growth(Gb)", \
    "moneta_fs_2014.txt" using 5 title "Feb-14 data growth(Gb)", \
    '' using 6 title "Mar-14 data growth(Gb)", \
    '' using 7 title "Apr-14 data growth(Gb)", \
    '' using 8 title "May-14 data growth(Gb)"

I ran this locally and it seems to work just fine.

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.