not just another anime blog
I got some advice and pointers in my last post but I’m afraid I’m stuck again. I was able to convert the time stamps and get it into Excel and it now looks like this:

How do I go from that to something like this?
mwgamera recommended gnuplot:
1. Get times sorted ascending (records are alredy sorted so just revers the whole file with tac).
2. Simple perl script (like this one: http://phpfi.com/198770) to convert it to better format.
3. Use gnuplot (for example with this: http://phpfi.com/198773)
4. The result: http://img441.imageshack.us/img441/6742/129ux2.png
Unfortunately, I don’t even understand the first step. Reverse? So the time comes before the vote answer? What is the easiest way to achieve that? Tac? What do I need to do in order to run the script? I have ActivePerl.
visitors since 2005
13 Responses for "Graphs still drive me insane"
if you plan on using excel, you need make columns C and D equal to the vote counts (i believe this is what that perl script does)
set C1 to “=0+(A1=172)”
set C2 to “=C1+(A2=172)”
click C2, then use the little dot in the bottom right of the cell to to drag it down to the final row, which will expand the formula down the entire column. for column D;
set D1 to “=0+(A1=173)”
set D2 to “=D1+(A2=173)”
then repeat the process. you should have four columns, the final two showing the cumulative vote count for each candidate at a given time. use “Format Cells” to change column Bs format to a time format. then select columns B, C, D and set up your line graph. or save as a csv and import into gnuplot.
‘tac’ is one of the standard commands in unix-like systems. It prints the file in reverse, last line becomes first.
I did it this way, because you’ve provided SQL dump as a text file and I didn’t want to import it, just to use as is. However, probably much better would be to get this data directly from database with this script and prepare it for gnuplot in one step. In fact, this can be done with anything, even PHP on server-side would do (it may be even more comfortable). And of course this plot I’ve shown is very raw. It can be made less ugly with gnuplot, probably it may be even similar to this one made with excel (but to achieve this I would need to check the manual).
At least, with gnuplot, you don’t need human interaction to generate plot, once you made a script. And it can be even automatically generated with use of cron or something like that.
And unfortunately, I don’t know how do you run script with ActivePerl because I don’t have Windows.
Try this: disqualify both. Problem solved. The end.
>>>Try this: disqualify both. Problem solved. The end.
The point of the graph isn’t to decide whether to disqualify someone or not.
Or at least I hope not.
No I’m sure it’s not about deciding legitimate votes. It’s just a way of showing how the battle progressed. And since we can’t see the running counts any more, it’d be cool to have graphs after each battle.
I think I give up. If the interest is there I could dump the relevant data each day and wait for some kind soul to do it and then put it in the post.
>mwgamera
Get the data from the database with what script? I use phpMyAdmin when I have to mess around with the database.
i think the graphs are cool, especially now that we’re voting blind. i’ll make graphs if you post the data.
Great. I will post Rika vs Fate when it is over.
1. get gnuplot (http://www.gnuplot.info/)
2. add it to PATH (in my computer->settings->something->environment variables append directory where gnuplot.exe is to PATH variable)
3. save this -> http://phpfi.com/199379 as graph.pl
4. add this line:
(’Misuzu Kamio (Air)’,'Suigintou (Rozen Maiden)’)
to your .sql file
5. run cmd (start->run->cmd) and change dir to whereve you saved your .pl file
6. enter following:
andrey@a1111:~$ perl graph.pl wp_pollsip.sql battle
and you’ll get battle.png file in same dir with your silly graph
abq, You should post all data from previous battles as well.
Yay, I got it to work! I will go through the previous rounds eventually. Thanks anonymous (all of you?) and mwgamera
Leave a reply