Range = 2.0 #Range for the absolute jiggle Set title 'Check this out! XKCD in Gnuplot' Set arrow from first 0, graph 0.95 to first 0, graph 1 size 2,3 front Set arrow from graph 0.95, first 0 to graph 1, first 0 size 2,3 front Set style line 2 lt 1 lc rgbcolor "#0000ff" lw 4 #blue Set style line 1 lt 1 lc rgbcolor "#ff0000" lw 4 #red Set style line 11 lt 1 lc rgbcolor "#000000" lw 4 #black Set style line 10 lt 1 lc rgbcolor "#ffffff" lw 15 #thick white Set term postscript eps font 'HumorSans' fontfile 'Humor-Sans.pfa' 22 # Since I already did that, you can just use the file included in this git repository. # To use it in the eps terminal, you have to convert it to a postscript pfa format # You can download the HumorSans font from here: # gnuplot, but this is way beyond the time that I can use on this. The other end point can be specified using any of three different mechanisms. The position of the first end point of the arrow is always specified by 'from'. # The proper way to do this would be to write a xkcd terminal for For example, you may start out with Gnuplot and later switch to Matplotlib. To change any attribute of an existing arrow, use set arrow with the appropriate tag and specify the attributes to be changed. reset Show plot with data style vectors set title 'Plot 'file' with vectors ' set key box opaque set xrange : set yrange :10 set for i1:8 style arrow i lc i plot '1.dat' using 1:2: ( 1): ( 1) with vectors lt 4 filled title 'filled', \ '2.dat' using 1:2: ( 1): ( 1.For datapoints, one can do the jiggling on both Click here for minimal script to generate this plot. # Also, when plotting functions, the jiggling can only be done in # Not a proper rendition, as the axis are still straight lines # Gnuplot file that plots a couple of functions in the xkcd style This doesn't attempt to be anywhere close to how sophisticated some of those other attempts were, as gnuplot offers much less in terms of programmability or access to the graphics pipeline than some of them, but the end result is not too bad! Also, it can certainly be improved :) It seems that all the rage these days is to get xkcd-style plots out of every plotting alternative out there.Īfter seeing the renditions of the same idea in Mathematica, Matplotlib, R and even in LaTeX!, gnuplot also deserved a shot. How to plot xkcd-style functions with gnuplot!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |