First plot disappear when moving mouse wheel - gnuplot

I plot my data with multi-plot(two plots arraged by two rows one column ) by gnuplot5.2 in a script. And I get my plot perfectly--the completed plot is output to screen because I set term win.
But when I move mouse wheel in the window screen, the first plot(the upper one) disappeared and never come back again. Only the second plot remains on screen.
Does anyone meet the same problem? And anyone can help me finding back the disappeared plot on screen?

It seems that moving the mouse wheel triggers a replot which only repeats the last plot command. Therefore I'm afraid that the disappeared plot can not be restored.
But it would be a nice feature.
Update:
If your subplots have the same ranges, you can try this (ugly) workaround. Split your script into two files like that:
# a.plt
reset
set xrange [0:pi]
set yrange [-1:1]
load "b.plt"
and
# b.plt
set multiplot layout 2,1
plot sin(x)
plot cos(x)
unset multiplot
Then, in the first run, start gnuplot and run a.plt with
load "a.plt"
And then, after each mouse wheel action, reload and run b.plt with
load "b.plt"
The two plots must have the same ranges because gnuplot remembers only the last settings, changes them according to your mouse wheel action, and applies them to both plots. In my opinion this is a limitation which renders the workaround nearly unusable.

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: Too many tooltips appearing at once on HTML canvas, causes browser freeze

I'm using gnuplot to create a scatter plot with potentially quite a few data points (greater than 1,000,000). I use the following command to plot the data and allow tooltips on mouse hover (the terminal is html canvas as these plots are meant to be displayed in a website):
plot "$resultsFile" using 2:(stringcolumn(8) eq "chr$chrom"?\$5:1/0):1 with labels hypertext point pt 7 ps var lc rgb "black"
The issue I'm having is: when I move my mouse over a dense cluster of datapoints, so many tooltips are displayed as the mouse moves that the browser freezes for a few seconds or even longer in an attempt to display them all. Does anyone know a way to stop this from happening? Perhaps by adding a delay before the tooltip is displayed on mouse over.

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.

Rotating 3D plots with the mouse in multiplot mode

When I do the following in gnuplot ...
set terminal x11
splot sin(x)
I can rotate the 3d plot with the mouse
On the other hand, if I do the following
set terminal x11
set multiplot layout 1,2
splot sin(x)
splot cos(x)
I can't rotate sin(x) or cos(x) even though I would love to. Does anybody know if it is possible to create a multiplot with plots that you can rotate?
Unfortunately you can't. Ethan A. Merritt, one of the gnuplot developers, here explained why:
Fundamental limitation. The "multiplot" command is best understood as
meaning "don't start a new page for the next plot". So your commands
have created two separate plots, that just happen to be on the same
page. Gnuplot only tracks the data for one plot at a time, so you can
only redraw the most recent plot. All earlier plots are long gone.

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