Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted
Just wondering if anyone knows of a script, or a program that can be run to quickly create a Graph of simple two column data in a CSV file? Want to do something automatically each day but too lazy thought it would be more efficent than doing this manually all the time.
Posted

Thanks for the suggestions both.

 

Plot.ly appears to be an online service, which unforuntalty kinda takes the automation out of it. As for Gnuplot... at the moment I can't get my head around importing data from a CSV.

Posted
Thanks for the suggestions both.

 

Plot.ly appears to be an online service, which unforuntalty kinda takes the automation out of it. As for Gnuplot... at the moment I can't get my head around importing data from a CSV.

 

It's an API, so you can program to send off the data and get back the image.

  • Thanks 1
Posted
Thanks for the suggestions both.

Plot.ly appears to be an online service, which unforuntalty kinda takes the automation out of it. As for Gnuplot... at the moment I can't get my head around importing data from a CSV.

Do you have some sample data?

  • Thanks 1
Posted
Do you have some sample data?

 

Good point... example CSV data in code tags below.

 

User,Pages
Alex,234
Bob,215
Carol,63
Daisy,61
Edward,55
Freya,25

Posted

So I create a file with your data "thedata.csv" and a file "SpecFile.txt" which contains the following :

 

set title 'My Graph'
set ylabel 'Pages'
set xlabel 'People'
set term png
set output 'test.png'
set datafile separator ","
plot "thedata.csv" using 2:xticlabels(1) with histogram

 

I can then produce a graph from the command line :

 

C:\Progra~1\gnuplot\bin\gnuplot < SpecFile.txt

 

test.png

 

Not pretty but hopefully that is helpful as a starting point.

  • Thanks 1
Posted
So I create a file with your data "thedata.csv" and a file "SpecFile.txt" which contains the following :

 

set title 'My Graph'
set ylabel 'Pages'
set xlabel 'People'
set term png
set output 'test.png'
set datafile separator ","
plot "thedata.csv" using 2:xticlabels(1) with histogram

 

I can then produce a graph from the command line :

 

C:\Progra~1\gnuplot\bin\gnuplot < SpecFile.txt

 

[ATTACH=CONFIG]43756[/ATTACH]

 

Not pretty but hopefully that is helpful as a starting point.

 

Thanks very much @pcstru, brilliant starting point! :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...