well, set datafile missing NaN will draw a continuous line both in 5.2.8 and 6.0.2, but how to get the graph with a break in 6.0.2?
gnuplot 6.x no data plotted after NaN with lc palette z
Thanks, Ethan! So, in summary: it is not intended to put the grid in front of the legend. Actually, it is prevented by design.
How to get grid to front?
Missing documentation for various terminals (gnuplot>=6.0.0)
Missing documentation for various terminals (gnuplot>=6.0.0)
Thanks, this clarifies it. Apparently, this was my lack of understanding how it works. So, the idea for boxplot is not necessarily to have data in different columns, but in one and another one for indicating the respective box. Data can even be in random order, sorted by first occurrence. I was also positively surprised that lc var works as well. reset session $Data <<EOD 3 One 1 Two 1 Three 6 One 2 One 6 Two 4 One 5 Three 9 Two 1 One 3 Three 7 Two 8 Two 4 Two 2 Three 5 One 4 Three 4 Three EOD set...
Missing xticlabels in boxplot
Missing xticlabels in boxplot
Thank you for the quick fix!
Error using stats and arrays with certain names in certain sequence
Thank you, Ethan, for that background information. Sorry, I was not logged in that's why this appeared under "anonymous". The example above was with wxt terminal and I would be interested in a correct width for wxt, qt, png, gif, pdf terminals, but probably it's similar there. I don't care about .ps or .eps. So, as I understand, generally, this can't be done. For curiosity and better understanding, in the example of wxt terminal: 1. how is gnuplot making its guess about the width of the key box?...
Thank you, Motoyoshi-san, for your effort. The feature request was simply about the ability to perform mathematical operation between two datasets/datablocks which don't have identical x-values. I know, I could basically achieve this task with any programming language, but starting from a datablock, going via an external tool and possible external files sounded cumbersome to me if, instead, there could be a simple gnuplot option (e.g. smooth linear). Actually, from gnuplot 5.4.0 on (June 2020), I...
what do you actually want to do? Plotting a datablock with double empty lines into another datablock, preserving the double empty lines? If you just need a copy (with empty lines) then you could do: set print $Copy print $Data set print I can suggest another (bit lengthy) workaround, but with table: $Data <<EOD 1 10 2 20 3 30 4 40 EOD stats $Data u 0 nooutput # get number of blocks set table $Temp do for [i=0:STATS_blocks-1] { plot $Data u 1:2 index i w table, \ '+' u ('') every ::::1 w table # two...
what do you actually want to do? Plotting a datablock with double empty lines into another datablock, preserving the double empty lines? If you just need a copy (with empty lines) then you could do: set print $Copy print $Data set print I can suggest another (bit lengthy) workaround, but with table: $Data <<EOD 1 10 2 20 3 30 4 40 EOD stats $Data u 0 nooutput # get number of blocks set table $Temp do for [i=0:STATS_blocks-1] { plot $Data u 1:2 index i w table, \ '+' u ('') every ::::1 w table # two...
Thank you for the quick response. You are right, there is probably no way in gnuplot 5.4 to create an empty array other than defining an empty one. Since arrays are convenient in many cases, I was thinking about this when having a gnuplot template script and a programming language modifying it, e.g. with the output of a calculation, which is a sequence of numbers, but which could also be no number. A simplified example: array A = [] # this line will be replaced by external script, but array could...
Wrong array size for empty arrays
Wrong array size for empty arrays
Indicator/variable if logscale is set or not
Oops, right. I haven't thought about multiple terminal windows. Yes, I could possibly display several measurements/graphs in multiple, e.g. wxt windows. However, that's what I (in my case) actually want to avoid and therefore I am using multiplot in a single terminal window.
There is a workaround... I would say it is ok for plotted labels, however, not ideal, e.g. for xticlabels. At least it looks like the label is rotated and centered around the tic as a whole text box. See https://stackoverflow.com/a/74076892/7295599
Sorry, although I did a short check about "multiplot" and "mouse" I did not find the "historic" feature request #35. Thank you for the background information. Yes, I was only hoping/asking for mouse coordinates in the original multiplot, i.e. no zooming, etc. For each plot the necessary values are stored in the GPVAL_ variables after plotting, however, with one exception: there is no GPVAL_ variable if logscale was set or or unset. Either new variables are required, e.g. GPVAL_X_LOG_SET and GPVAL_Y_LOG_SET...
Sorry, although I did a short check about "multiplot" and "mouse" I did not find the "historic" feature request #35. Thank you for the background information. Yes, I was only hoping/asking for mouse coordinates in the original multiplot, i.e. no zooming, etc. For each plot the necessary values are stored in the GPVAL_ variables after plotting, however, with one exception: there is no GPVAL_ variable if logscale was set or or unset. Either new variables are required, e.g. GPVAL_X_LOG_SET and GPVAL_Y_LOG_SET...
Mouse coordinates in multiplots
Thank you for this background information. Yes, this was my expectation: If I write some whatever text on a label and if I rotate this label, the text is rotated as a whole. ...the baseline of the text will be set to the specified angle. What is the baseline or anchor point of a multi-line text? The line (anchor point) of the first row or the average of the baselines (anchor points) of all lines? Apparently, a multi-line text has multiple base lines (anchor points), and as you say, all baselines...
Misalignment of rotated multiline labels
Sorry, again... for curiosity: Currently, in both matrices (uniform and nonuniform), column(0) is the "useless" integer of column(3). So, instead (to my opinion) the column index could/should be put there. Then for a uniform matrix column(2) == column(-1) and column(1) == column(0). This would be redundant but doesn't hurt. For a uniform matrix the following script ### column indices in uniform matrix $Data <<EOD 11.1 21.2 31.3 12.1 22.2 32.3 13.1 23.2 33.3 14.1 24.2 34.3 EOD set table $Test plot...
Thank you very much! Actually, I hoped to directly have the column index in column(0). As you write, now I have to always determine M first, which is (to my opinion) an avoidable extra step (for the user in the script). Why should I be interested in linear order numbers of values in a matrix (unlike in tabular data)? I would say only row and column index are of importance and you can calculate the linear order if (at all) needed. column(0)/M would be redundant, because I have the row-index already...
pseudocolumn 0 in a nonuniform matrix
Thank you Ethan for checking. Ok, so, it's not a bug, maybe a feature. I see, I didn't think of binary matrix. It seems to be there at least in gnuplot 4.6, maybe "since ever". Then there probably was some intention behind it. So, I will file a feature request. And this case can be closed.
Matrix and pseudocolumns
Such a "findword()" function would nice. In your case you don't necessarily need extra arrays for that. For this type of recurrent task, I guess a hash or dictionary would be the desired feature. Although, you can create a lookup or hash table by misusing the sum() function. Check the two links which are similar to your task: https://stackoverflow.com/a/72289393/7295599 https://stackoverflow.com/a/67710390/7295599
Just in case, there is a workaround: Script: ### column indices in matrix, gnuplog-workaround $Data <<EOD X 1 3 7 0 11.1 21.2 31.3 2 12.1 22.2 32.3 5 13.1 23.2 33.3 9 14.1 24.2 34.3 EOD colIdxFix(n) = (r0=r1,r1=column(-1),r0==r1?c=c+1:c=1) set table $Test plot r1=c=0 $Data nonuniform matrix u -2:-1:0:1:2:3:(colIdxFix(0)) w table unset table print $Test ### end of script Result: 0 0 11 1 0 11.1 1 0 0 21 3 0 21.2 2 0 0 31 7 0 31.3 3 0 1 12 1 2 12.1 1 0 1 22 3 2 22.2 2 0 1 32 7 2 32.3 3 0 2 13 1 5 13.1...
Matrix and pseudocolumns
This can be solved in a different way: instead of covering visible curves with "invisible" paint, you simply blank out the data at the (un)desired location(s). See: https://stackoverflow.com/a/70219551/7295599
I thought about the following example below, but maybe this is a different case because gnuplot always tries to make a floating point number out of data? And with real() trailing "junk" will always(?) be ignored? But why making a difference for int()? reset session $Data <<EOD 1 20.0°C 50%r.h. 2 25.3°C 55%r.h. 3 30.4°C 40%r.h. 4 37.5°C 35%r.h. EOD set ytics nomirror set y2tics plot $Data u 1:2 w lp, '' u 1:3 axis x1y2 w lp Do I assume right that something like (admittedly not a good real world example)...
Just for curiosity... why do you want to change the old behavior for string to int in the following cases? gnuplot> print int("1e2") 100 "Trailing characters after numeric" gnuplot> print int("1f2") 1 "Trailing characters after numeric" gnuplot> print int("1.f2") 1 "Trailing characters after numeric" In some cases it might be convenient (and not hurting anybody) according to the premise: if possible try to make an integer out of it and only if it is not possible throw an error.
Wrong mouseformat 2 in logscale!?
Wrong mouseformat 2 in logscale!?
Wrong mouseformat 2 in logscale!?
Wrong mouseformat 2 in logscale!?
Wrong mouseformat 2 in logscale!?
Different order for variable ps and pt since 5.4 ?
Documentation: linetype does not work for textcolor [duplicate, please remove]
Sorry, I don't see how I can delete this ticket, since it was submitted twice...
Documentation: linetype does not work for textcolor
Documentation: linetype does not work for textcolor
(same comment on SO) well, writing to a temporary file certainly works. I hope there will be no file opening, writing, closing and re-reading timing issues. If I have data in (fast) RAM, why should I write it to (slow) HDD just for sorting it? If you just sort once, the longer time might not be an issue. If you have to sort again and again, this would go towards data processing and analysis, and gnuplot doesn't want to be a tool for such tasks. My simple hope was that zsort (although is was not intended...
gnuplot's zsort (Windows) does not preserve order
fillsteps exceeds graph
fillsteps exceeds graph
Sorry, for not providing a clearer example. Let me try again. I want a histogram of time data in a table. (I guess your first example above will not work, see Example A below). Code: ### How to get a time histogram into a table? reset session $Data <<EOD 2021-02-10 00:00:01 2021-02-10 00:00:01 2021-02-10 00:00:01 2021-02-10 00:00:02 2021-02-10 00:00:02 2021-02-10 00:00:03 2021-02-10 00:00:04 2021-02-10 00:00:04 2021-02-10 00:00:04 2021-02-10 00:00:04 2021-02-10 00:00:04 EOD # this will give a graph...
Now, I nevertheless have an issue with this: How would I use this together with smooth freq, e.g. for creating histograms with a bin size of a few hours or minutes or even seconds? Variation 1: set table $TimeTable plot $Data u (timecolumn(1,myTimeFmt))):(1) smooth freq unset table Variation 2: (using sprintf()) set table $TimeTable plot $Data u (sprintf("%.3f",timecolumn(1,myTimeFmt))):(1) smooth freq unset table Variation 3: (using sprintf() and with table) set table $TimeTable plot $Data u (sprintf("%.3f",timecolumn(1,myTimeFmt))):(1)...
Now, I nevertheless have an issue with this: How would I use this together with smooth freq, e.g. for creating histograms with a bin size of a few hours or minutes or even seconds? Variation 1: set table $TimeTable plot $Data u (timecolumn(1,myTimeFmt))):(1) smooth freq unset table Variation 2: (using sprintf()) set table $TimeTable plot $Data u (sprintf("%.3f",timecolumn(1,myTimeFmt))):(1) smooth freq unset table Variation 3: (using sprintf() and with table) set table $TimeTable plot $Data u (sprintf("%.3f",timecolumn(1,myTimeFmt))):(1)...
I see, number/unit alignment in axis labels is another viewpoint. Your monospace example with two spaces does not look good to me, but this is just a personal feeling. Here is a document from SI (BIPM): www.bipm.org/utils/common/pdf/si_brochure_8_en.pdf Section 5.3.3. Formatting the value of a quantity The numerical value always precedes the unit, and a space is always used to separate the unit from the number. Thus the value of the quantity is the product of the number and the unit, the space being...
Since I do not know C, here is a gnuplot attempt to fix this issue. It was triggered by the answer to this StackOverflow question: https://stackoverflow.com/q/65863357/7295599 I guess this should be easily transferrable to C. Code: ### gnuplot "fix" for prefix for %c 1-999 prefix(power) = "yzafpnum kMGTPEZY"[(power+24)/3+1 : (power+24)/3 + sgn(abs(power))] do for [power=-24:24:3] { print sprintf("% 3g '%s'", power, prefix(power)) } ### end of code Result: -24 'y' -21 'z' -18 'a' -15 'f' -12 'p' -9...
Since I do not know C, here is a gnuplot attempt to fix this issue. It was triggered by the answer to this StackOverflow question: https://stackoverflow.com/q/65863357/7295599 I guess this should be easily transferrable to C. Code: ### gnuplot "fix" for prefix for %c 1-999 prefix(power) = "yzafpnum kMGTPEZY"[(power+24)/3+1 : (power+24)/3 + sgn(abs(power))] do for [power=-24:24:3] { print sprintf("% 3g '%s'", power, Prefix(power)) } ### end of code Result: -24 'y' -21 'z' -18 'a' -15 'f' -12 'p' -9...
Since I do not know C, here is a gnuplot attempt to fix this issue. It was triggered by the answer to this StackOverflow question: https://stackoverflow.com/q/65863357/7295599 I guess this should be easily be transferrable to C. Code: ### gnuplot "fix" for prefix for %c 1-999 prefix(power) = "yzafpnum kMGTPEZY"[(power+24)/3+1 : (power+24)/3 + sgn(abs(power))] do for [power=-24:24:3] { print sprintf("% 3g '%s'", power, Prefix(power)) } ### end of code Result: -24 'y' -21 'z' -18 'a' -15 'f' -12 'p'...
Oops, a bug in the bug fix. Here is a version which should be correct now also for 2007/2008. A year has 53 weeks if either Jan 01 or Dec 31 is a Thursday. Sorry, I cannot help with C-code. Edit: made the gnuplot-code a bit "nicer". Code: ### Bug fix V1.2 for week number according to ISO 8601 reset session dow(t) = int(tm_wday(t)) ? tm_wday(t) : 7 # day of week 1=Mon, ..., 7=Sun week(t) = int((11 + tm_yday(t) - dow(t))/7) # "raw"week of year wday(d,m,y) = tm_wday(strptime("%d.%m.%Y",sprintf("%02d.%02d.%04d",d,m,y)))...
Oops, a bug in the bug fix. Here is a version which should be correct now also for 2007/2008. A year has 53 weeks if either Jan 01 or Dec 31 is a Thursday. Sorry, I cannot help with C-code. Edit: made the gnuplot-code a bit "nicer". Code: ### Bug fix V1.2 for week number according to ISO 8601 reset session dow(t) = int(tm_wday(t)) ? tm_wday(t) : 7 # day of week 1=Mon, ..., 7=Sun week(t) = int((11 + tm_yday(t) - dow(t))/7) # "raw"week of year wday(d,m,y) = tm_wday(strptime("%d.%m.%Y",sprintf("%02d.%02d.%04d",d,m,y)))...
Oops, a bug in the bug fix. Here is a version which should be correct now also for 2007/2008. A year has 53 weeks if either Jan 01 or Dec 31 is a Thursday. Sorry, I cannot help with C-code. Edit: made the gnuplot-code a bit "nicer". Code: ### Bug fix V1.2 for week number according to ISO 8601 reset session dow(t) = int(tm_wday(t)) ? tm_wday(t) : 7 # day of week 1=Mon, ..., 7=Sun week(t) = int((11 + tm_yday(t) - dow(t))/7) # "raw"week of year wday(d,m,y) = tm_wday(strptime("%d.%m.%Y",sprintf("%02d.%02d.%04d",d,m,y)))...
Oops, a bug in the bug fix. Here is a version with should be correct now also for 2007/2008. A year has 53 weeks if either Jan 01 or Dec 31 is a Thursday. Sorry, I cannot help with C-code. Edit: made the gnuplot-code a bit "nicer". Code: ### Bug fix V1.2 for week number according to ISO 8601 reset session dow(t) = int(tm_wday(t)) ? tm_wday(t) : 7 # day of week 1=Mon, ..., 7=Sun week(t) = int((11 + tm_yday(t) - dow(t))/7) # "raw"week of year wday(d,m,y) = tm_wday(strptime("%d.%m.%Y",sprintf("%02d.%02d.%04d",d,m,y)))...
Oops, a bug in the bug fix. Here is a version with should be correct now also for 2007/2008. A year has 53 weeks if either Jan 01 or Dec 31 is a Thursday. Sorry, I cannot help with C-code. Code: ### Bug fix week number ISO reset session dow(t) = int(tm_wday(t)) ? tm_wday(t) : 7 # day of week 1=Mon, ..., 7=Sun week(t) = int((11 + tm_yday(t) - dow(t))/7) # "raw"week of year wday(d,t) = tm_wday(strptime("%d.%m.%Y",d.strftime("%Y",t))) # week day of certain date jan01(t) = strptime("%Y",strftime("%Y",t))...
The following suggestion should do the fix... well, in gnuplot code, not in C-code ... Maybe there are shorter and smarter solutions... Code: ### Bug fix week number ISO reset session dow(t) = int(tm_wday(t)) ? tm_wday(t) : 7 # day of week 1=Mon, ..., 7=Sun week(t) = int((11 + tm_yday(t) - dow(t))/7) # "raw"week of year jan01(t) = tm_wday(strptime("%Y",strftime("%Y",t))) # dow of Jan 1st dec31(t) = tm_wday(strptime("%d.%m.%Y","31.12.".strftime("%Y",t))) # dow of Dec 31 wpy(t) = 52 + ((jan01(t)==4...
Error in documentation: tm_yday()
Sorry, my fault for not having checked help with table. Besides this, I thought standard precision for %g was 6 digits. So, no bug at all. Happy New Year!
Sorry, my fault for not having checked help with table. Besides this, I thought standard precision for %g was 6 digits. So, no bug at. Happy New Year!
the following is also limited in precision, it is basically identical to what timecolumn() does. plot $Data u (strptime(myTimeFmt,strcol(1)." ".strcol(2))):3 w table
missing precision with timecolumn() together with table
missing precision with timecolumn() together with table
Wrong key alignment in multiplot
Ethan, thank you very much for your effort. Unfortunately, I'm working under Windows and I don't know (yet) how to compile gnuplot from source myself, otherwise might be able to test your patch with different hypertexts. I guess I need to learn how to compile from source (under Windows), but I haven't yet taken the time to search for good step-by-step instructions. I took your attached PDF example where you used the hypertext "something not really a URI". As it could be already expected, different...
Thank you for the detailed explanations and the background. I see, it is a complex matter, heritage, compatibility, consistency, etc... I didn't want to complain, I was just wondering... I guess this "bug" report can be closed as "not-a-bug" or "works-for-me".
Thank you Ethan, for your explanations. Maybe I haven't expressed myself clear enough. I don't want that linetype repeats every 8, and I don't want pointtype to repeat every 8 as well. If I needed, e.g. set pointtype cycle 8, I would have set the linetype in a do for loop. Actually, I agree, it's very good that linestyle repeats every 120, e.g. for the example you mentioned. Yes, I assumed that the variation of colors every 8 = 2*2*2 and the pointtypes variation every 15 = 3*5 was clearly intentionally....
Thank you Ethan, for your explanations. Maybe I haven't expressed myself clear enough. I don't want that linetype repeats every 8, and I don't want pointtype to repeat every 8 as well. If I needed, e.g. set pointtype cycle 8, I would have set the linetype in a do for loop. Actually, I agree, it's very good that linestyle repeats every 120, e.g. for the example you mentioned. Yes, I assumed that the variation of colors every 8 = 2*2*2*2 and the pointtypes variation every 15 = 3*5 was clearly intentionally....
Unexpected (un)specifed linetypes
Linear resampling of data?
Hypertext for PDF terminal?
animated gif optimize does not work as expected
prefix %c and %b for 1-999
prefix %c and %b for 1-100
interpretation of negative times
Thank you! Ah, sorry, didn't know about this one. I thought it would have to be hardcoded into the interactive terminal. Very good that you can customize it. What about mouse coordinates in multiplots? As far as I can tell, only the coordinates of the last multiplot-subplot are accessible. I assume this is a coordinate transformation from screen pixels to graph coordinates. I'm aware that this won't work for multiplots which are on top of each other, but are there any chances that this could somehow...
Displaying date/time in interactive window according to current format
just to illustrate that something is not as expected with %t and %T (even when used as a pair). Well, it's not directly gprintf(). Isn't the 0.95 x 10^2 somehow unesthetic and unexpected? set yrange[80:100] set format y "%t x 10^{%T}" plot x
What do you get, e.g. if you type print floor(log10(1e6))?
Thank you for your fast response. Well, the fact that %t and %T can only be used as a pair does not become clear from the gnuplot documentation (help format specifiers). Maybe I missed the essential sentence and you can link me to it. How would you explain the ytics in: set yrange[80:100] set format y "%t x 10^{%T}" plot x Although, I'm using %t and %T together, I get0.950000 x 10^2 for 95. However, if I set format y "%.6t x 10^{%T}" get 9.500000 x 10^1 for 95. Isn't this a bit inconsistent? Actually,...
gprintf: inconsistencies with %t and %T