![]() E.g., if you look at the pdf version of this figure, you will notice that there is a border to this rectangle. This might not take effect in all terminals. Note that the rectangle in gray has no boundary, i.e., that is set to zero width. The next step is to draw two rectangles in the front of the graph: one gray (this is going to be the shadow), and one white (this will contain the keys). This might be useful, when you don't know the plotting range beforehand, and want to let gnuplot calculate it for you. If you don't want the gradient, you can drop these definitions, and you haven't got to specify the range in the plot either. ![]() I should also point out that the first four numbers that are needed for the xrange and yrange, are needed only because we have to "synchronise" the plot with its background, i.e., we have to make the background gradient exactly as big as the actual plot. The next three lines are necessary only if you want to draw the background gradient, but if you are happy with a white plot, you can skip this. 'key1' and 'key2' are just two arbitrary strings, holding the text of the key. The next number (lh) gives the hight of one key line, while 'al' will be the length of the line which represents the curve. This is why it is handy to define them at the beginning of the script, so if you are not satisfied with the results, you can easily adjust both the position and the size. We will have to make our own key, and the size of the key will depend on the particular terminal and font one uses. The next four numbers specify the position and the size of the key. The first four numbers define the xrange and the yrange. We collect all variables at the beginning of the script, so that it will be easier to adapt it to any situations. Set arrow from graph rx, ry+lh rto al, 0 lt 3 lw 1.5 nohead front Set arrow from graph rx, ry+2*lh rto al, 0 lt 1 lw 1.5 nohead front Set label 2 at graph 1.1*al+rx, ry+lh key2 front Set label 1 at graph 1.1*al+rx, ry+2*lh key1 front Set object 2 rect from graph rx-eps,ry+eps rto kw,kh front fs empty Set object 1 rect from graph rx,ry rto kw,kh fc rgb "#aaaaaa" fs solid 1.0 front lw 0 I believe the steps are quite straightforward, so I will not spend too much time on explaining every detail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |