gnuplot: fill area curve keeping tics on top - gnuplot

in gnuplot, when you try to fill an area under a curve, the tics of both axes are hinded behind the solid area.
Is there any way to give them to the front?
I am using postcript terminal, where no transparent features are allowed (i guess)
Thanks

There sure is! Before plotting, run this interactively or in a script:
set tics front
Try help tics interactively for more info.

After trying many options I realized that the following works properly:
set tics front
It seems important to write it before the plot command.
;-)

Related

Gnuplot pm3d at sb

This is my second question today, I thought about editing the other one with this info but the problems doesn't seem to be related... So, with this data file, and using this code:
set terminal qt
s=101
set size square
set palette rgb 34,35,36;
set zrange[-1.8e-5:1.8e-5]
set pm3d at sb
set autoscale fix
do for [i=0:0]{
splot 'itp.txt' u 1:2:3 every:::(i*s)::(s+i*s) notitle w pm3d
}
I get this black image. This is clearly not working properly... but if I slide my finger through my notebook's touchpad while in the qt's output interactive window, this image pops up, which is what I wanted. It seems to work everywhere, except when the graph fit the "canvas". Example 1 & example 2. I'm not even sure what sliding my fingers through the touchpad while on qt's output window does, but it seems to be fixing something. So what should I do? Thank you in advance!
*qt is the qt terminal in gnuplot
Looking at the two figures you posted, it seems that the effect has to do with a changing xrange. I copied your datafile and script, and adding:
set xrange[-200:300]
did the trick for me. Also, you may consider fixing (if at all possible) your color bar range, by adding:
set cbrange[xx:xx]
with your data, I tried:
set cbrange[0:1.8e-8]
and the result looks completely different. Hope this helps.

gnuplot: how to remove colorbox with splot

I am trying to plot the following only without the colorbox
As you can see I have tweaked it a bit, removed x/y axes, the title, some borders, but I can't figure out how to remove the colorbox. I would be grateful if someone could take a look and let me know if they have a hint/idea. Thank you all in advance.
Assuming that, by z-axis, you mean that you want to remove the colorbox, then adding the line
unset colorbox
will remove it from your plot. For future reference, you can find a lot of helpful information on these options by typing help unset into the Gnuplot terminal, or for more general support, just help.

Improving gnuplot 3d plots from data files with pm3d

I'm trying to graph an approximate solution (finite element method) to the Navier-Stokes equation. I've got a file called plotNSu1 that looks like this:
6 1 4.21022e-34
5.95 1 8.15227e-34
5.9693 0.970854 0.055197
6 1 4.21022e-34
5.9693 0.970854 0.055197
6 0.95 0.0941333
6 1 4.21022e-34
5.9693 0.970854 0.055197
5.92625 0.951192 0.0915468
5.9693 0.970854 0.055197
5.95 1 8.15227e-34
5.92625 0.951192 0.0915468
...
(The entries are x y z, grouped so that there's a blank line between each set of 4 points).
I use the following command to plot:
splot "plotNSu1" with lines
Butt I would like to make it look nicer, easier to read. (There's a small dip at one spot that's difficult to see, but is an important part of the solution).
I've found lots of examples using pm3d interpolate, but none seem to work for me. I've tried set style pm3d, and other set style commands, I've tried set pm3d map interpolate 10,10, and splot "plotNSu1" with pm3d, as well as so many other similar things stolen from the examples I've found that I can't keep track. Most of the time I just get an empty window with the color key and no plot, and often it sends me an empty 2d window.
I would like to have the color change with the contour of the plot, to make the little dip easier to see. Does anyone know how to do this? Here's one of the websites I've been trying to use, to see what I'm aiming for: http://gnuplot.sourceforge.net/demo/pm3d.html
I tried to post the image, but as I do not have enough reputation, I can't. But it's difficult to see what's going on because the graph is just all red.
I found a way to make this work, more or less, thanks to #Christoph's help and this other question suggested by stackoverflow: gnuplot pm3d plot triangle data
With my data in the file described above, in gnuplot I type:
set dgrid3d
set pm3d corners2color c2
splot "plotNSu1" using 1:2:3 with pm3d
The result isn't perfect, it looks a little choppy, but it basically does what I wanted, I can see the "dip" in my graph much better now.

force graphs legend/key to a specific size

i want to generate some plots from my data that i want to include in some documentation.
I put the box outside the graph area.
the problem is that for different plots the box has different sizes so also the graph area changes its size. this looks very messy in the document becasue the plots are vertical aligned.
I am searching for a way to fix the size of the box to some width that is appropriate for all plots but i could not found a way to do so.
the set key command has a width parameter but it seems not to do that one would expect from such a parameter.
It would be grat if someone could help.
thanks
vlad
I hope I got the correct impression of what you want. Consider the following example
reset
set multiplot layout 2,1
set rmargin screen 0.7
set key reverse Left left top at screen 0.72, graph 1
plot sin(x), cos(x) t 'long title'
plot sin(x), cos(x) t 'very long title'
unset multiplot
Which gives you:
Both the samples and the text do not move. You must only set an appropriate rmargin. left and top is the key box alignment regarding the position specified with at ..., although these settings are default, I explicitely included them for clarity. Left is the alignment of the entry text.

Why doesn't the gnuplot grid extend over this whole plot?

Using gnuplot 4.6 patchlevel 1, with the following commands,
set grid linewidth 1 linecolor rgb"#888888"
set datafile separator ","
plot for [n=2:100] "data.csv" using 1:(column(n)) with lines linewidth 2
and the following example data in the file "data.csv",
time,S1,S2
0,0.00015,0
0.1,0.0001357256127053939,1.427438729460607e-005
0.2,0.0001228096129616973,2.719038703830272e-005
0.3,0.0001111227331022577,3.887726689774233e-005
0.4,0.0001005480069053459,4.945199309465411e-005
0.5,9.097959895689501e-005,5.902040104310499e-005
0.6,8.232174541410396e-005,6.767825458589604e-005
0.7,7.448779556871142e-005,7.551220443128858e-005
0.8,6.739934461758323e-005,8.260065538241677e-005
0.9,6.098544896108986e-005,8.901455103891014e-005
1,5.518191617571635e-005,9.481808382428365e-005
the resulting plot looks this:
Question: why does the grid only extend partway from the bottom, and not cover the whole plot? I tried a considerable amount of experimentation with the set xtics and ytics commands, arguments to grid, and more, and have not been able to get the grid to cover the whole plot. What am I missing?
Great question! In fact, the answer is that the grid does cover the whole plot. The problem is that the key is taking over. Try it again, but with an unset key in there before your plot command.
What's happening is that gnuplot is reserving space in the key for all of the columns which have no data. Nothing gets put in the space that was reserved since no reasonable data was found. Ultimately, this pushes the 2 lines that were visible out of the viewable canvas area as well.
I've reproduced this using the x11, png, postscript and pngcairo terminals.
Note that this behavior seems to be version dependent:
With gnuplot 4.4.2 (OS-X, png terminal)
With gnuplot 4.6.0 (OS-X, png terminal)
For those using gnuplot 4.4.4, perhaps there was a bug fix which made it work for gnuplot 4.4.4 and then a regression. It seems to persist into gnuplot 4.7.0 as well. I might file a bug report.

Resources