Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot and "Failed to initialize wxWidgets"

Tags:

gnuplot

i want to plot120 files with gnuplot.

plot '18205.plot' u 1:3 w l t '18205' , '18208.plot' u 1:3 w l t '18208'
Failed to initialize wxWidgets.
         warning: Warning - difficulty fitting plot titles into key
         warning: Too many axis ticks requested (>1e+01)
         warning: Too many axis ticks requested (>1e+01)
         warning: Too many axis ticks requested (>6)

the files looking like

21      4       0.865671
22      4       0.894175
23      4       0.921895
24      4       0.949053
25      4       0.975792
26      4       1.00147
27      4       1.02577
28      4       1.05008
like image 581
Roby Avatar asked May 23 '11 12:05

Roby


5 Answers

The important bit is this:

Failed to initialize wxWidgets.

This means that gnuplot couldn't open a window to plot using wxWidgets. Be sure that the terminal where you are running gnuplot can open windows in X. You can do that by typing echo $DISPLAY in the terminal (or !echo $DISPLAY from within gnuplot) and checking if it's not empty and if it makes sense (usually this means a value of :0.0. If it should be anything different, you should know that because you have set it up that way ;) ).

Setting the right X permissions is also necessary if you are running gnuplot as a different user (or on a different host e.g. via ssh) than the one running the graphic environment. in a secure environment xhost + would do, but if you are on a network and specially not behind a firewall, xhost server-running-gnuplot.domain would be a much wiser choice.

like image 71
Elton Carvalho Avatar answered Nov 10 '22 09:11

Elton Carvalho


Apparently this is it failing to detect a terminal it likes. On my Debian stable "gnuplot 4.4 patchlevel 0" I get an identical error until I add some:

set terminal png

...at which point it works fine. Raaage!

like image 34
FauxFaux Avatar answered Nov 10 '22 11:11

FauxFaux


I was getting the same errors. However, I realised that I did not have X permissions in my current terminal window. This would explain why switching terminal formats to non-X (ie. jpg/png) worked for the guys above as well.

like image 33
Kieron Avatar answered Nov 10 '22 11:11

Kieron


As the warning suggest you probably have too many keys in you plot. Try leaving away the titles and set key off.
Also you might want to take a look at iterations like in THIS blog at the bottom. This would clean up your script quite a lot.
You might want to ask yourself if you really want to plot 120 lines in a singe plot!?

like image 2
Woltan Avatar answered Nov 10 '22 11:11

Woltan


just set area size, such as:

set terminal png size 1500 1200

and then plot

like image 1
dmitry_podyachev Avatar answered Nov 10 '22 10:11

dmitry_podyachev