You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(2) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(3) |
Feb
(1) |
Mar
(2) |
Apr
(22) |
May
(52) |
Jun
(43) |
Jul
(36) |
Aug
(59) |
Sep
(37) |
Oct
(55) |
Nov
(39) |
Dec
(36) |
| 2005 |
Jan
(64) |
Feb
(40) |
Mar
(62) |
Apr
(58) |
May
(256) |
Jun
(77) |
Jul
(80) |
Aug
(39) |
Sep
(56) |
Oct
(36) |
Nov
(113) |
Dec
(68) |
| 2006 |
Jan
(43) |
Feb
(64) |
Mar
(69) |
Apr
(60) |
May
(71) |
Jun
(53) |
Jul
(63) |
Aug
(63) |
Sep
(76) |
Oct
(85) |
Nov
(82) |
Dec
(73) |
| 2007 |
Jan
(75) |
Feb
(82) |
Mar
(84) |
Apr
(104) |
May
(67) |
Jun
(101) |
Jul
(107) |
Aug
(138) |
Sep
(128) |
Oct
(106) |
Nov
(112) |
Dec
(112) |
| 2008 |
Jan
(94) |
Feb
(87) |
Mar
(146) |
Apr
(169) |
May
(75) |
Jun
(26) |
Jul
(26) |
Aug
(7) |
Sep
(18) |
Oct
(53) |
Nov
(42) |
Dec
(19) |
| 2009 |
Jan
(43) |
Feb
(39) |
Mar
(18) |
Apr
(45) |
May
(66) |
Jun
(87) |
Jul
(56) |
Aug
(41) |
Sep
(56) |
Oct
(139) |
Nov
(98) |
Dec
(88) |
| 2010 |
Jan
(81) |
Feb
(79) |
Mar
(83) |
Apr
(97) |
May
(124) |
Jun
(84) |
Jul
(53) |
Aug
(85) |
Sep
(89) |
Oct
(50) |
Nov
(98) |
Dec
(78) |
| 2011 |
Jan
(97) |
Feb
(74) |
Mar
(68) |
Apr
(54) |
May
(63) |
Jun
(59) |
Jul
(65) |
Aug
(58) |
Sep
(37) |
Oct
(40) |
Nov
(59) |
Dec
(35) |
| 2012 |
Jan
(16) |
Feb
(56) |
Mar
(63) |
Apr
(25) |
May
(48) |
Jun
(58) |
Jul
(20) |
Aug
(13) |
Sep
(43) |
Oct
(35) |
Nov
(20) |
Dec
(17) |
| 2013 |
Jan
(22) |
Feb
(11) |
Mar
(51) |
Apr
(34) |
May
(57) |
Jun
(27) |
Jul
(70) |
Aug
(30) |
Sep
(38) |
Oct
(53) |
Nov
(40) |
Dec
(25) |
| 2014 |
Jan
(26) |
Feb
(35) |
Mar
(60) |
Apr
(12) |
May
(17) |
Jun
(15) |
Jul
(9) |
Aug
(18) |
Sep
(46) |
Oct
(18) |
Nov
(19) |
Dec
(15) |
| 2015 |
Jan
(17) |
Feb
(28) |
Mar
(21) |
Apr
(54) |
May
(36) |
Jun
(8) |
Jul
(30) |
Aug
(13) |
Sep
(3) |
Oct
(28) |
Nov
(3) |
Dec
(3) |
| 2016 |
Jan
(11) |
Feb
(9) |
Mar
(29) |
Apr
(10) |
May
(8) |
Jun
(5) |
Jul
(50) |
Aug
(57) |
Sep
(13) |
Oct
(5) |
Nov
(17) |
Dec
(11) |
| 2017 |
Jan
(3) |
Feb
(23) |
Mar
(16) |
Apr
(7) |
May
(15) |
Jun
(12) |
Jul
(48) |
Aug
(15) |
Sep
(3) |
Oct
(20) |
Nov
(28) |
Dec
(21) |
| 2018 |
Jan
(13) |
Feb
(21) |
Mar
(21) |
Apr
(7) |
May
(3) |
Jun
(7) |
Jul
(27) |
Aug
(38) |
Sep
(4) |
Oct
(30) |
Nov
(22) |
Dec
|
| 2019 |
Jan
(5) |
Feb
(16) |
Mar
(1) |
Apr
(9) |
May
(7) |
Jun
(20) |
Jul
(13) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(2) |
Dec
(4) |
| 2020 |
Jan
(6) |
Feb
(11) |
Mar
(1) |
Apr
(18) |
May
(4) |
Jun
(5) |
Jul
(12) |
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(17) |
| 2021 |
Jan
(1) |
Feb
(11) |
Mar
(16) |
Apr
(6) |
May
(5) |
Jun
(1) |
Jul
(1) |
Aug
(2) |
Sep
(8) |
Oct
(10) |
Nov
(4) |
Dec
(4) |
| 2022 |
Jan
(9) |
Feb
(35) |
Mar
(4) |
Apr
|
May
(3) |
Jun
(49) |
Jul
(11) |
Aug
|
Sep
(5) |
Oct
(2) |
Nov
(16) |
Dec
(13) |
| 2023 |
Jan
|
Feb
(8) |
Mar
(3) |
Apr
|
May
(8) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2024 |
Jan
(6) |
Feb
(9) |
Mar
|
Apr
(26) |
May
(24) |
Jun
|
Jul
(4) |
Aug
(2) |
Sep
(1) |
Oct
(10) |
Nov
(9) |
Dec
|
| 2025 |
Jan
|
Feb
(22) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
|
From: Grant E. <gra...@gm...> - 2021-02-25 18:50:15
|
I have a graph were I do
set offset graph 0.1, graph 0.1, graph 0.1, graph 0.1;
and then plot two columns of a file: one x1y1, one x1y2. The offset
doesn't seem to be applied to the y2 axis. How do I set offset for the
secondary y axis? The manual implies this is not possible:
Offsets
Offsets provide a mechanism to put an empty boundary around the
data inside an autoscaled graph. The offsets only affect the x1
and y1 axes, and only in 2D plot commands.
Is there really no way to set offsets for secondary axes?
|
|
From: Juanjo M. <mel...@un...> - 2021-02-22 12:03:16
|
Hi all I am running gnuplot (5.0 patchlevel 1) on MacOS with Catalina. In other machines, gnuplot displays coordinates at the bottom-left corner as the mouses moves, but I cannot get the same on my Mac. I tried with the “format” and “mouseformat” options, but I did not succeed so far. Apart from that, gnuplot seems to be correctly installed. Could you help me, please? Thanks in advance Juan J. Meléndez Martínez Departamento de Física Universidad de Extremadura Avda. de Elvas, s/n 06006 Badajoz Teléfono: 924 28 96 55 Fax: 924 28 96 51 Email: mel...@un... <mailto:mel...@un...> Web: materiales.unex.es/miembros/personal/jj-melendez/Index.html |
|
From: Norwid B. <nb...@ya...> - 2021-02-17 11:56:06
|
If your refer to CDF format is about "Computable Document Format" by Wolfram Research, chances gnuplot will adopt this as an output format will be low. According to Wikipedia's entry, it is not an open format (contrast to, e.g., .pdf or .png): https://en.wikipedia.org/wiki/Computable_Document_Format If you refer to an other format than the one mentioned above, you are welcome to add additional details pointing to a typical creator program known to you, public standards about this format, etc. This eases recognition of the file type, and maybe triggers its implementation as permanent record written by future versions of Gnuplot. |
|
From: Mohammed B. <moh...@gm...> - 2021-02-17 11:28:39
|
Hello Sir/Madam I am a master student using gnuplot for plotting my data in txt format. How can i plot data in CDF format ? |
|
From: Dave H. <da...@ho...> - 2021-02-03 02:05:23
|
On Tue, 2 Feb 2021, Ethan Merritt wrote: > I do not understand how the script could ever have worked correctly > without either "set link y2" or "set y2range [min:max]". Well, stuffed if I know how it managed to work since 2013 when I first wrote it (with minor tweaks); I think we can safely file this under "H" for "Heisenbug" :-) Explicitly setting "y2range [0:160]" (the same as "yrange" because it happened to be the same scale) fixed it; there's probably a better way but I like to spell things out (I might want to change the scale(s) one day), and it may have something to do with different captions. Many thanks! I dunno how I missed that, or how it even worked at all... -- Dave |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2021-02-02 23:08:41
|
Am 02.02.2021 um 23:17 schrieb Dave Horsfall: > The error: > > gnuplot> load 'health.gp' > "health.gp" line 99: warning: y2 axis range undefined or overflow That warning message appears justified, because there's a bug in the plot script (at least the one you showed). It doesn't really make much sense to request ticks on the y2 axis, but nothing else: no data on the y2 axis itself, nor any stated relation between y1 and y2 axis, FWIW, I suspect adding set link y2 should reinstate the behaviour of older versions of gnuplot for you. OTOH, if you were actually going to use the second y axis, there should be 'axis x1y2' options on the applicable datasets (Sys, Dia). |
|
From: Dave H. <da...@ho...> - 2021-02-02 22:52:52
|
On Tue, 2 Feb 2021, Ethan Merritt wrote: >> gnuplot> load 'health.gp' >> "health.gp" line 99: warning: y2 axis range undefined or overflow > > Since your script never sets a range for y2 at all that error message is > evidently correct. > > I do not understand how the script could ever have worked correctly > without either "set link y2" or "set y2range [min:max]". That's the bit that had me confused; it had been working for ages... > Could the script have gotten borked? Not according to the modification time unless it was some weird corruption. Anyway I'll explicitly set the y2range as you suggested. Thanks. -- Dave |
|
From: Ethan M. <eam...@gm...> - 2021-02-02 22:41:40
|
On Tuesday, 2 February 2021 14:17:59 PST Dave Horsfall wrote: > Gnuplot 5.4 patchlevel 1 on MacBook Pro Sierra 10.12.6 (updated each > week). > > On 1st February (I don't know whether the date is significant) my daily > health plot suddenly lost its R/H axis. I didn't do nuffink... > > Well, there was a MacPorts update that morning, but I didn't see Gnuplot > in the list; I guess it's possible that something got borked, but just the > R/H axis? Gnuplot was last updated on 25th Jan, and worked up until now. > > As it was on 31st Jan: http://www.horsfall.org/health.pdf.old (no HTTPS > yet). > > Now: http://www.horsfall.org/health.pdf > > Well, all I did was to add an entry for 1st Feb: > > # Date Time Wgt Gth Sys Dia HR > > 30/1/21 1800 89.9 109 115 72 77 > 31/1/21 1730 88.6 109 118 72 95 > ==> 1/2/21 1830 88.6 109 115 67 82 > 2/2/21 1730 90.3 109 118 60 69 > > The error: > > gnuplot> load 'health.gp' > "health.gp" line 99: warning: y2 axis range undefined or overflow Since your script never sets a range for y2 at all that error message is evidently correct. I do not understand how the script could ever have worked correctly without either "set link y2" or "set y2range [min:max]". Could the script have gotten borked? Ethan > > Note that line 99 is actually the last continued line of the "plot" > command, which I certainly had not changed: > > mackie:health dave$ ls -l *.gp > -rw-r--r-- 1 dave staff 5511 Sep 27 2019 health.gp > > (Note that the one I attached has potentially sensitive comments removed; > it's my personal information, after all, but I'm willing to share the lot > with an individual, not the entire list.) > > It's worth noting that the plot has probably saved my life a few times, as > I suffer from hypertension (with medication)... > > The script itself is attached (I trust that it's within the guidelines). > > Thanks. > > -- Dave |
|
From: Dave H. <da...@ho...> - 2021-02-02 22:34:31
|
Gnuplot 5.4 patchlevel 1 on MacBook Pro Sierra 10.12.6 (updated each week). On 1st February (I don't know whether the date is significant) my daily health plot suddenly lost its R/H axis. I didn't do nuffink... Well, there was a MacPorts update that morning, but I didn't see Gnuplot in the list; I guess it's possible that something got borked, but just the R/H axis? Gnuplot was last updated on 25th Jan, and worked up until now. As it was on 31st Jan: http://www.horsfall.org/health.pdf.old (no HTTPS yet). Now: http://www.horsfall.org/health.pdf Well, all I did was to add an entry for 1st Feb: # Date Time Wgt Gth Sys Dia HR 30/1/21 1800 89.9 109 115 72 77 31/1/21 1730 88.6 109 118 72 95 ==> 1/2/21 1830 88.6 109 115 67 82 2/2/21 1730 90.3 109 118 60 69 The error: gnuplot> load 'health.gp' "health.gp" line 99: warning: y2 axis range undefined or overflow Note that line 99 is actually the last continued line of the "plot" command, which I certainly had not changed: mackie:health dave$ ls -l *.gp -rw-r--r-- 1 dave staff 5511 Sep 27 2019 health.gp (Note that the one I attached has potentially sensitive comments removed; it's my personal information, after all, but I'm willing to share the lot with an individual, not the entire list.) It's worth noting that the plot has probably saved my life a few times, as I suffer from hypertension (with medication)... The script itself is attached (I trust that it's within the guidelines). Thanks. -- Dave |
|
From: Marco <li...@ho...> - 2021-01-01 18:07:41
|
Hi,
I have a rather simple data file which is arranged in columns.
However, gnuplot prefers the data in rows and I don't know if
there's a way to plot the data without preprocessing (which I'd like
to avoid).
Here's the sample data:
Time;10;20;30;40;50
Mag;100;200;400;750;950
Att;120;280;550;790;350
Sol;210;820;550;970;530
It's easy to plot it if it would be laid out in rows:
set datafile separator ";"
set key autotitle columnheader
$DATA << EOD
Time;Mag;Att;Sol
10;100;120;210
20;200;280;820
30;400;550;550
40;750;790;970
50;950;350;530
EOD
plot $DATA using 1:2 w l, \
'' using 1:3 w l, \
'' using 1:4 w l
Is there a way gnuplot can handle the data file laid out in columns?
I tried using matrix but couldn't get the expected result. Any tips
appreciated.
Marco
|
|
From: <qin...@st...> - 2020-12-30 16:41:37
|
I added the command system("chmod +x myscript.sh ") in gnuplot script.
It indeed makes myscript.sh become executable.
But the variable passing (index of loop k) is still not successful. And I have another worry that $1 in awk command means the first column of data file.
The gnuplot script is
system("chmod +x myscript.sh ")
system("bash -c ./myscript.sh ".sprintf("%.1f", k))
plot for [k= 1: 20: 1] "< bash ./myscript.sh" u 1:2
the myscript.sh is
paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk -v vtime=$1 ' {if($1==vtime*1.0) { e[$3] += $4; m[$3] += $9}} END { for ( i in e) { print i , e[i], m[i], vtime}}' h is
For your convenience to test. I share some data file with you through the OneDrive link as follow.
https://stkyotouac-my.sharepoint.com/:u:/g/personal/qin_zhihao_87m_st_kyoto-u_ac_jp/EbyAJ0_82mlMu_4bnTYK0m4B2fl1Yw7UIPju3tOVsQq_9Q?e=VJcgTW
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月30日 22:51
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: 回?: 回?: 回?: [Gnuplot-info] system command in gnuplot
Without testing (I might have time later), there are two things that look like they need to be fixed:
1. in order for "./myscript.sh" not to have the 'Permission denied' error, it needs to be executable. You can do this on the command line with> chmod +x myscript.sh
2. When a bash script takes command line arguments, they have the names $1, $2, etc. So, you might have to change $k to $1.
Andy
On Wed, Dec 30, 2020 at 2:29 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Thanks for your answer.
But there are some other problems.
When I do
>system("bash -c ./myscript.sh ".sprintf("%.1f", k))
An error appears : nan: ./myscript.sh: : Permission denied
I modified the command as system("/bin/bash combine.sh ".sprintf("%.1f", k))
The script is executed. However, not only passing the variable k, the whole script is executed.
What I want is that executing the
plot for [k= 1: 20: 1] "< bash ./myscript.sh" u 1:2
the index of loop k can be paased into the script as a variable (the red parameter as follow).
The code in the script is
paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk -v vtime=$k ' {if($1==vtime*1.0) { e[$3] += $4; m[$3] += $9}} END { for ( i in e) { print i , e[i], m[i], vtime}}'
For your convenience to test, I send you some data files。
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月30日 5:32
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: 回?: 回?: [Gnuplot-info] system command in gnuplot
You can definitely pass arguments to a bash script. In the script, you use the arguments as variables $1, $2, etc. (Reference example: https://www.golinuxcloud.com/beginners-guide-to-use-script-arguments-in-bash-with-examples/).
It will take some fiddling to construct the command in gnuplot, but if the variables are var1 and var2 for example, you can do it like this:
> system("bash -c ./myscript.sh ".var1." ".var2)
The '.' concatenates the string variables. If var1 or var2 is a number like 16.0 instead of a string "16.0", you might have to do something like the below with sprintf to get it to turn into a string correctly:
> system("bash -c ./myscript.sh ".var1." ".sprintf("%.1f", var2))
Andy
On Tue, Dec 29, 2020 at 12:48 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Dear Andy
As your advice, we can reduce syntax / escape errors by put the paste / awk script in a separate file ("myscript.sh").
Then call it from inside gnuplot as plot "< bash ./myscript.sh"
But if the data file name (Q_byE_i*.txt) is a string variable and “16.0” of “if($1==16.0” in awk part is also a variable,
How can I pass these variables from gnuplot into myscript.sh.
Because I'm not very familiar with linux, my questions might be very basic or stupid.
please forgive me.
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月29日 1:13
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: 回?: [Gnuplot-info] system command in gnuplot
Yes, you should be able to make a similar modification, something like:
plot "< bash -c 'paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk \'{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}\''"
I can't test it out, so you might have to escape some additional characters (* etc.).
When you are using a command that is this complicated, a way to simplify things and reduce syntax / escape errors is to put the paste / awk script in a separate file ("myscript.sh") and call that script from inside gnuplot:
plot "< bash ./myscript.sh"
Andy
On Mon, Dec 28, 2020 at 9:31 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Dear Andy
Thank you very much.
It worked. But I have another question.
In fact, I tried to merge some data files, then plot a graph.
The code is
plot "< paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk '{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}'" u 1:2
The latter part of code about ‘awk’, I think there is no problem. Could I modify the code as the system("bash -c 'paste <(ls Q*) <(ls F*)'")?
Qin
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月28日 23:57
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: [Gnuplot-info] system command in gnuplot
Hello,
Your error comes from the fact that gnuplot is running the system command using the sh shell instead of bash (or whatever your usual shell is). You can get the command to be interpreted by bash like this:
system("bash -c 'paste <(ls Q*) <(ls F*)'")
Andy
On Mon, Dec 28, 2020 at 4:11 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Hello
Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
The information of operating system as follow
Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
LSB Version: n/a
Distributor ID: SUSE
Description: SUSE Linux Enterprise Server 12 SP3
Release: 12.3
Codename: n/a
My question:
I am trying to launch a system command in gnuplot like
Terminal type is now 'qt'
gnuplot> system(" paste <(ls Q*) <(ls F*)")
show me the error message as
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
But if I exit the gnuplot and run the command, it can work.
qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
any help would be much appreciated
have a nice day
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
_______________________________________________
gnuplot-info mailing list
gnu...@li...<mailto:gnu...@li...>
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
|
|
From: Andrew R. <an...@gm...> - 2020-12-30 13:51:35
|
Without testing (I might have time later), there are two things that look
like they need to be fixed:
1. in order for "./myscript.sh" not to have the 'Permission denied' error,
it needs to be executable. You can do this on the command line with>
chmod +x myscript.sh
2. When a bash script takes command line arguments, they have the names $1,
$2, etc. So, you might have to change $k to $1.
Andy
On Wed, Dec 30, 2020 at 2:29 AM qin...@st... <
qin...@st...> wrote:
> Thanks for your answer.
>
> But there are some other problems.
>
> When I do
>
> >system("bash -c ./myscript.sh ".sprintf("%.1f", k))
>
> An error appears : nan: ./myscript.sh: : Permission denied
>
>
>
> I modified the command as system("/bin/bash combine.sh ".sprintf("%.1f",
> k))
>
> The script is executed. However, not only passing the variable k, the
> whole script is executed.
>
>
>
> What I want is that executing the
>
> plot for [k= 1: 20: 1] "< bash ./myscript.sh" u 1:2
>
> the index of loop k can be paased into the script as a variable (the red
> parameter as follow).
>
>
>
> The code in the script is
>
> paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk -v vtime=$k '
> {if($1==vtime*1.0) { e[$3] += $4; m[$3] += $9}} END { for ( i in e) { print
> i , e[i], m[i], vtime}}'
>
>
>
> For your convenience to test, I send you some data files。
>
>
>
> ****************************************************
> 秦志豪
> 京都大学大学院 エネルギー科学研究科
> エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
> 岸本研究室
> E-mail : qin...@st...
> ****************************************************
>
>
>
> *发件人: *Andrew Rasmussen <an...@gm...>
> *发送时间: *2020年12月30日 5:32
> *收件人: *qin...@st...
> *抄送: *gnu...@li...
> *主题: *Re: 回?: 回?: [Gnuplot-info] system command in gnuplot
>
>
>
> You can definitely pass arguments to a bash script. In the script, you use
> the arguments as variables $1, $2, etc. (Reference example:
> https://www.golinuxcloud.com/beginners-guide-to-use-script-arguments-in-bash-with-examples/
> ).
>
>
>
> It will take some fiddling to construct the command in gnuplot, but if the
> variables are var1 and var2 for example, you can do it like this:
>
>
>
> > system("bash -c ./myscript.sh ".var1." ".var2)
>
>
>
> The '.' concatenates the string variables. If var1 or var2 is a number
> like 16.0 instead of a string "16.0", you might have to do something like
> the below with sprintf to get it to turn into a string correctly:
>
>
>
> > system("bash -c ./myscript.sh ".var1." ".sprintf("%.1f", var2))
>
>
>
> Andy
>
>
>
> On Tue, Dec 29, 2020 at 12:48 AM qin...@st... <
> qin...@st...> wrote:
>
> Dear Andy
>
> As your advice, we can reduce syntax / escape errors by put the paste /
> awk script in a separate file ("myscript.sh").
>
> Then call it from inside gnuplot as plot "< bash ./myscript.sh"
>
> But if the data file name (Q_byE_i*.txt) is a string variable and “16.0” of
> “if($1==16.0” in awk part is also a variable,
>
> How can I pass these variables from gnuplot into myscript.sh.
>
>
>
> Because I'm not very familiar with linux, my questions might be very basic
> or stupid.
>
> please forgive me.
>
> ****************************************************
> 秦志豪
> 京都大学大学院 エネルギー科学研究科
> エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
> 岸本研究室
> E-mail : qin...@st...
> ****************************************************
>
>
>
> *发件人: *Andrew Rasmussen <an...@gm...>
> *发送时间: *2020年12月29日 1:13
> *收件人: *qin...@st...
> *抄送: *gnu...@li...
> *主题: *Re: 回?: [Gnuplot-info] system command in gnuplot
>
>
>
> Yes, you should be able to make a similar modification, something like:
>
>
>
> plot "< bash -c 'paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk
> \'{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}\''"
>
>
>
> I can't test it out, so you might have to escape some additional
> characters (* etc.).
>
>
>
> When you are using a command that is this complicated, a way to simplify
> things and reduce syntax / escape errors is to put the paste / awk script
> in a separate file ("myscript.sh") and call that script from inside gnuplot:
>
>
>
> plot "< bash ./myscript.sh"
>
>
>
> Andy
>
>
>
> On Mon, Dec 28, 2020 at 9:31 AM qin...@st... <
> qin...@st...> wrote:
>
> Dear Andy
>
>
>
> Thank you very much.
>
> It worked. But I have another question.
>
> In fact, I tried to merge some data files, then plot a graph.
>
> The code is
>
> plot "< paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk '{if($1==16.0)
> { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}'" u 1:2
>
>
>
> The latter part of code about ‘awk’, I think there is no problem. Could I
> modify the code as the system("bash -c 'paste <(ls Q*) <(ls F*)'")?
>
>
>
> Qin
>
>
>
> ****************************************************
> 秦志豪
> 京都大学大学院 エネルギー科学研究科
> エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
> 岸本研究室
> E-mail : qin...@st...
> ****************************************************
>
>
>
> *发件人: *Andrew Rasmussen <an...@gm...>
> *发送时间: *2020年12月28日 23:57
> *收件人: *qin...@st...
> *抄送: *gnu...@li...
> *主题: *Re: [Gnuplot-info] system command in gnuplot
>
>
>
> Hello,
>
>
>
> Your error comes from the fact that gnuplot is running the system command
> using the sh shell instead of bash (or whatever your usual shell is). You
> can get the command to be interpreted by bash like this:
>
>
>
> system("bash -c 'paste <(ls Q*) <(ls F*)'")
>
>
>
> Andy
>
>
>
> On Mon, Dec 28, 2020 at 4:11 AM qin...@st... <
> qin...@st...> wrote:
>
> Hello
>
> Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
> The information of operating system as follow
> Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5
> (SUSE Linux) )
> LSB Version: n/a
> Distributor ID: SUSE
> Description: SUSE Linux Enterprise Server 12 SP3
> Release: 12.3
> Codename: n/a
>
> My question:
> I am trying to launch a system command in gnuplot like
> Terminal type is now 'qt'
> gnuplot> system(" paste <(ls Q*) <(ls F*)")
>
> show me the error message as
> sh: -c: line 0: syntax error near unexpected token `('
> sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
>
> But if I exit the gnuplot and run the command, it can work.
> qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
>
> any help would be much appreciated
> have a nice day
>
> ****************************************************
> 秦志豪
> 京都大学大学院 エネルギー科学研究科
> エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
> 岸本研究室
> E-mail : qin...@st...
> ****************************************************
>
>
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
>
>
>
>
>
|
|
From: <qin...@st...> - 2020-12-30 08:47:39
|
Thanks for your answer.
But there are some other problems.
When I do
>system("bash -c ./myscript.sh ".sprintf("%.1f", k))
An error appears : nan: ./myscript.sh: : Permission denied
I modified the command as system("/bin/bash combine.sh ".sprintf("%.1f", k))
The script is executed. However, not only passing the variable k, the whole script is executed.
What I want is that executing the
plot for [k= 1: 20: 1] "< bash ./myscript.sh" u 1:2
the index of loop k can be paased into the script as a variable (the red parameter as follow).
The code in the script is
paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk -v vtime=$k ' {if($1==vtime*1.0) { e[$3] += $4; m[$3] += $9}} END { for ( i in e) { print i , e[i], m[i], vtime}}'
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月30日 5:32
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: 回?: 回?: [Gnuplot-info] system command in gnuplot
You can definitely pass arguments to a bash script. In the script, you use the arguments as variables $1, $2, etc. (Reference example: https://www.golinuxcloud.com/beginners-guide-to-use-script-arguments-in-bash-with-examples/).
It will take some fiddling to construct the command in gnuplot, but if the variables are var1 and var2 for example, you can do it like this:
> system("bash -c ./myscript.sh ".var1." ".var2)
The '.' concatenates the string variables. If var1 or var2 is a number like 16.0 instead of a string "16.0", you might have to do something like the below with sprintf to get it to turn into a string correctly:
> system("bash -c ./myscript.sh ".var1." ".sprintf("%.1f", var2))
Andy
On Tue, Dec 29, 2020 at 12:48 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Dear Andy
As your advice, we can reduce syntax / escape errors by put the paste / awk script in a separate file ("myscript.sh").
Then call it from inside gnuplot as plot "< bash ./myscript.sh"
But if the data file name (Q_byE_i*.txt) is a string variable and “16.0” of “if($1==16.0” in awk part is also a variable,
How can I pass these variables from gnuplot into myscript.sh.
Because I'm not very familiar with linux, my questions might be very basic or stupid.
please forgive me.
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月29日 1:13
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: 回?: [Gnuplot-info] system command in gnuplot
Yes, you should be able to make a similar modification, something like:
plot "< bash -c 'paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk \'{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}\''"
I can't test it out, so you might have to escape some additional characters (* etc.).
When you are using a command that is this complicated, a way to simplify things and reduce syntax / escape errors is to put the paste / awk script in a separate file ("myscript.sh") and call that script from inside gnuplot:
plot "< bash ./myscript.sh"
Andy
On Mon, Dec 28, 2020 at 9:31 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Dear Andy
Thank you very much.
It worked. But I have another question.
In fact, I tried to merge some data files, then plot a graph.
The code is
plot "< paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk '{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}'" u 1:2
The latter part of code about ‘awk’, I think there is no problem. Could I modify the code as the system("bash -c 'paste <(ls Q*) <(ls F*)'")?
Qin
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月28日 23:57
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: [Gnuplot-info] system command in gnuplot
Hello,
Your error comes from the fact that gnuplot is running the system command using the sh shell instead of bash (or whatever your usual shell is). You can get the command to be interpreted by bash like this:
system("bash -c 'paste <(ls Q*) <(ls F*)'")
Andy
On Mon, Dec 28, 2020 at 4:11 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Hello
Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
The information of operating system as follow
Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
LSB Version: n/a
Distributor ID: SUSE
Description: SUSE Linux Enterprise Server 12 SP3
Release: 12.3
Codename: n/a
My question:
I am trying to launch a system command in gnuplot like
Terminal type is now 'qt'
gnuplot> system(" paste <(ls Q*) <(ls F*)")
show me the error message as
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
But if I exit the gnuplot and run the command, it can work.
qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
any help would be much appreciated
have a nice day
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
_______________________________________________
gnuplot-info mailing list
gnu...@li...<mailto:gnu...@li...>
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
|
|
From: Andrew R. <an...@gm...> - 2020-12-29 20:32:15
|
You can definitely pass arguments to a bash script. In the script, you use the arguments as variables $1, $2, etc. (Reference example: https://www.golinuxcloud.com/beginners-guide-to-use-script-arguments-in-bash-with-examples/ ). It will take some fiddling to construct the command in gnuplot, but if the variables are var1 and var2 for example, you can do it like this: > system("bash -c ./myscript.sh ".var1." ".var2) The '.' concatenates the string variables. If var1 or var2 is a number like 16.0 instead of a string "16.0", you might have to do something like the below with sprintf to get it to turn into a string correctly: > system("bash -c ./myscript.sh ".var1." ".sprintf("%.1f", var2)) Andy On Tue, Dec 29, 2020 at 12:48 AM qin...@st... < qin...@st...> wrote: > Dear Andy > > As your advice, we can reduce syntax / escape errors by put the paste / > awk script in a separate file ("myscript.sh"). > > Then call it from inside gnuplot as plot "< bash ./myscript.sh" > > But if the data file name (Q_byE_i*.txt) is a string variable and “16.0” > of “if($1==16.0” in awk part is also a variable, > > How can I pass these variables from gnuplot into myscript.sh. > > > > Because I'm not very familiar with linux, my questions might be very basic > or stupid. > > please forgive me. > > **************************************************** > 秦志豪 > 京都大学大学院 エネルギー科学研究科 > エネルギー基礎科学専攻 プラズマ・核融合基礎学分野 > 岸本研究室 > E-mail : qin...@st... > **************************************************** > > > > *发件人: *Andrew Rasmussen <an...@gm...> > *发送时间: *2020年12月29日 1:13 > *收件人: *qin...@st... > *抄送: *gnu...@li... > *主题: *Re: 回?: [Gnuplot-info] system command in gnuplot > > > > Yes, you should be able to make a similar modification, something like: > > > > plot "< bash -c 'paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk > \'{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}\''" > > > > I can't test it out, so you might have to escape some additional > characters (* etc.). > > > > When you are using a command that is this complicated, a way to simplify > things and reduce syntax / escape errors is to put the paste / awk script > in a separate file ("myscript.sh") and call that script from inside gnuplot: > > > > plot "< bash ./myscript.sh" > > > > Andy > > > > On Mon, Dec 28, 2020 at 9:31 AM qin...@st... < > qin...@st...> wrote: > > Dear Andy > > > > Thank you very much. > > It worked. But I have another question. > > In fact, I tried to merge some data files, then plot a graph. > > The code is > > plot "< paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk '{if($1==16.0) > { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}'" u 1:2 > > > > The latter part of code about ‘awk’, I think there is no problem. Could I > modify the code as the system("bash -c 'paste <(ls Q*) <(ls F*)'")? > > > > Qin > > > > **************************************************** > 秦志豪 > 京都大学大学院 エネルギー科学研究科 > エネルギー基礎科学専攻 プラズマ・核融合基礎学分野 > 岸本研究室 > E-mail : qin...@st... > **************************************************** > > > > *发件人: *Andrew Rasmussen <an...@gm...> > *发送时间: *2020年12月28日 23:57 > *收件人: *qin...@st... > *抄送: *gnu...@li... > *主题: *Re: [Gnuplot-info] system command in gnuplot > > > > Hello, > > > > Your error comes from the fact that gnuplot is running the system command > using the sh shell instead of bash (or whatever your usual shell is). You > can get the command to be interpreted by bash like this: > > > > system("bash -c 'paste <(ls Q*) <(ls F*)'") > > > > Andy > > > > On Mon, Dec 28, 2020 at 4:11 AM qin...@st... < > qin...@st...> wrote: > > Hello > > Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system. > The information of operating system as follow > Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5 > (SUSE Linux) ) > LSB Version: n/a > Distributor ID: SUSE > Description: SUSE Linux Enterprise Server 12 SP3 > Release: 12.3 > Codename: n/a > > My question: > I am trying to launch a system command in gnuplot like > Terminal type is now 'qt' > gnuplot> system(" paste <(ls Q*) <(ls F*)") > > show me the error message as > sh: -c: line 0: syntax error near unexpected token `(' > sh: -c: line 0: ` paste <(ls Q*) <(ls F*)' > > But if I exit the gnuplot and run the command, it can work. > qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*) > > any help would be much appreciated > have a nice day > > **************************************************** > 秦志豪 > 京都大学大学院 エネルギー科学研究科 > エネルギー基礎科学専攻 プラズマ・核融合基礎学分野 > 岸本研究室 > E-mail : qin...@st... > **************************************************** > > > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > > > > |
|
From: <qin...@st...> - 2020-12-29 06:48:21
|
Dear Andy
As your advice, we can reduce syntax / escape errors by put the paste / awk script in a separate file ("myscript.sh").
Then call it from inside gnuplot as plot "< bash ./myscript.sh"
But if the data file name (Q_byE_i*.txt) is a string variable and “16.0” of “if($1==16.0” in awk part is also a variable,
How can I pass these variables from gnuplot into myscript.sh.
Because I'm not very familiar with linux, my questions might be very basic or stupid.
please forgive me.
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月29日 1:13
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: 回?: [Gnuplot-info] system command in gnuplot
Yes, you should be able to make a similar modification, something like:
plot "< bash -c 'paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk \'{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}\''"
I can't test it out, so you might have to escape some additional characters (* etc.).
When you are using a command that is this complicated, a way to simplify things and reduce syntax / escape errors is to put the paste / awk script in a separate file ("myscript.sh") and call that script from inside gnuplot:
plot "< bash ./myscript.sh"
Andy
On Mon, Dec 28, 2020 at 9:31 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Dear Andy
Thank you very much.
It worked. But I have another question.
In fact, I tried to merge some data files, then plot a graph.
The code is
plot "< paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk '{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}'" u 1:2
The latter part of code about ‘awk’, I think there is no problem. Could I modify the code as the system("bash -c 'paste <(ls Q*) <(ls F*)'")?
Qin
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月28日 23:57
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: [Gnuplot-info] system command in gnuplot
Hello,
Your error comes from the fact that gnuplot is running the system command using the sh shell instead of bash (or whatever your usual shell is). You can get the command to be interpreted by bash like this:
system("bash -c 'paste <(ls Q*) <(ls F*)'")
Andy
On Mon, Dec 28, 2020 at 4:11 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Hello
Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
The information of operating system as follow
Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
LSB Version: n/a
Distributor ID: SUSE
Description: SUSE Linux Enterprise Server 12 SP3
Release: 12.3
Codename: n/a
My question:
I am trying to launch a system command in gnuplot like
Terminal type is now 'qt'
gnuplot> system(" paste <(ls Q*) <(ls F*)")
show me the error message as
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
But if I exit the gnuplot and run the command, it can work.
qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
any help would be much appreciated
have a nice day
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
_______________________________________________
gnuplot-info mailing list
gnu...@li...<mailto:gnu...@li...>
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
|
|
From: Andrew R. <an...@gm...> - 2020-12-28 16:13:45
|
Yes, you should be able to make a similar modification, something like:
plot "< bash -c 'paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk
\'{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}\''"
I can't test it out, so you might have to escape some additional characters
(* etc.).
When you are using a command that is this complicated, a way to simplify
things and reduce syntax / escape errors is to put the paste / awk script
in a separate file ("myscript.sh") and call that script from inside gnuplot:
plot "< bash ./myscript.sh"
Andy
On Mon, Dec 28, 2020 at 9:31 AM qin...@st... <
qin...@st...> wrote:
> Dear Andy
>
>
>
> Thank you very much.
>
> It worked. But I have another question.
>
> In fact, I tried to merge some data files, then plot a graph.
>
> The code is
>
> plot "< paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk '{if($1==16.0)
> { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}'" u 1:2
>
>
>
> The latter part of code about ‘awk’, I think there is no problem. Could I
> modify the code as the system("bash -c 'paste <(ls Q*) <(ls F*)'")?
>
>
>
> Qin
>
>
>
> ****************************************************
> 秦志豪
> 京都大学大学院 エネルギー科学研究科
> エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
> 岸本研究室
> E-mail : qin...@st...
> ****************************************************
>
>
>
> *发件人: *Andrew Rasmussen <an...@gm...>
> *发送时间: *2020年12月28日 23:57
> *收件人: *qin...@st...
> *抄送: *gnu...@li...
> *主题: *Re: [Gnuplot-info] system command in gnuplot
>
>
>
> Hello,
>
>
>
> Your error comes from the fact that gnuplot is running the system command
> using the sh shell instead of bash (or whatever your usual shell is). You
> can get the command to be interpreted by bash like this:
>
>
>
> system("bash -c 'paste <(ls Q*) <(ls F*)'")
>
>
>
> Andy
>
>
>
> On Mon, Dec 28, 2020 at 4:11 AM qin...@st... <
> qin...@st...> wrote:
>
> Hello
>
> Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
> The information of operating system as follow
> Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5
> (SUSE Linux) )
> LSB Version: n/a
> Distributor ID: SUSE
> Description: SUSE Linux Enterprise Server 12 SP3
> Release: 12.3
> Codename: n/a
>
> My question:
> I am trying to launch a system command in gnuplot like
> Terminal type is now 'qt'
> gnuplot> system(" paste <(ls Q*) <(ls F*)")
>
> show me the error message as
> sh: -c: line 0: syntax error near unexpected token `('
> sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
>
> But if I exit the gnuplot and run the command, it can work.
> qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
>
> any help would be much appreciated
> have a nice day
>
> ****************************************************
> 秦志豪
> 京都大学大学院 エネルギー科学研究科
> エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
> 岸本研究室
> E-mail : qin...@st...
> ****************************************************
>
>
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
>
|
|
From: <qin...@st...> - 2020-12-28 15:46:41
|
Dear Andy
Thank you very much.
It worked. But I have another question.
In fact, I tried to merge some data files, then plot a graph.
The code is
plot "< paste <(cat Q_byE_i*.txt) <(cat Q_byM_i*.txt)|awk '{if($1==16.0) { e[$3] += $4 }}END { for ( i in e) { print i , e[i]}}'" u 1:2
The latter part of code about ‘awk’, I think there is no problem. Could I modify the code as the system("bash -c 'paste <(ls Q*) <(ls F*)'")?
Qin
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...
****************************************************
?件人: Andrew Rasmussen<mailto:an...@gm...>
?送??: 2020年12月28日 23:57
收件人: qin...@st...<mailto:qin...@st...>
抄送: gnu...@li...<mailto:gnu...@li...>
主?: Re: [Gnuplot-info] system command in gnuplot
Hello,
Your error comes from the fact that gnuplot is running the system command using the sh shell instead of bash (or whatever your usual shell is). You can get the command to be interpreted by bash like this:
system("bash -c 'paste <(ls Q*) <(ls F*)'")
Andy
On Mon, Dec 28, 2020 at 4:11 AM qin...@st...<mailto:qin...@st...> <qin...@st...<mailto:qin...@st...>> wrote:
Hello
Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
The information of operating system as follow
Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
LSB Version: n/a
Distributor ID: SUSE
Description: SUSE Linux Enterprise Server 12 SP3
Release: 12.3
Codename: n/a
My question:
I am trying to launch a system command in gnuplot like
Terminal type is now 'qt'
gnuplot> system(" paste <(ls Q*) <(ls F*)")
show me the error message as
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
But if I exit the gnuplot and run the command, it can work.
qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
any help would be much appreciated
have a nice day
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...<mailto:qin...@st...>
****************************************************
_______________________________________________
gnuplot-info mailing list
gnu...@li...<mailto:gnu...@li...>
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
|
|
From: Andrew R. <an...@gm...> - 2020-12-28 14:57:18
|
Hello,
Your error comes from the fact that gnuplot is running the system command
using the sh shell instead of bash (or whatever your usual shell is). You
can get the command to be interpreted by bash like this:
system("bash -c 'paste <(ls Q*) <(ls F*)'")
Andy
On Mon, Dec 28, 2020 at 4:11 AM qin...@st... <
qin...@st...> wrote:
> Hello
>
> Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
> The information of operating system as follow
> Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5
> (SUSE Linux) )
> LSB Version: n/a
> Distributor ID: SUSE
> Description: SUSE Linux Enterprise Server 12 SP3
> Release: 12.3
> Codename: n/a
>
> My question:
> I am trying to launch a system command in gnuplot like
> Terminal type is now 'qt'
> gnuplot> system(" paste <(ls Q*) <(ls F*)")
>
> show me the error message as
> sh: -c: line 0: syntax error near unexpected token `('
> sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
>
> But if I exit the gnuplot and run the command, it can work.
> qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
>
> any help would be much appreciated
> have a nice day
>
> ****************************************************
> 秦志豪
> 京都大学大学院 エネルギー科学研究科
> エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
> 岸本研究室
> E-mail : qin...@st...
> ****************************************************
>
>
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
|
|
From: <qin...@st...> - 2020-12-28 10:11:14
|
Hello
Now I am using gnuplot (Version 5.2 patchlevel 6) on a Linux system.
The information of operating system as follow
Linux version 4.4.162-94.72-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
LSB Version: n/a
Distributor ID: SUSE
Description: SUSE Linux Enterprise Server 12 SP3
Release: 12.3
Codename: n/a
My question:
I am trying to launch a system command in gnuplot like
Terminal type is now 'qt'
gnuplot> system(" paste <(ls Q*) <(ls F*)")
show me the error message as
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: ` paste <(ls Q*) <(ls F*)'
But if I exit the gnuplot and run the command, it can work.
qin@csc1:~/qin /txt> paste <(ls Q*) <(ls F*)
any help would be much appreciated
have a nice day
****************************************************
秦志豪
京都大学大学院 エネルギー科学研究科
エネルギー基礎科学専攻 プラズマ・核融合基礎学分野
岸本研究室
E-mail : qin...@st...
****************************************************
|
|
From: Helmut H. <he...@ha...> - 2020-12-04 19:59:05
|
Hi, Alex,
Sorry for not responding earlier. The fontscale used is the same on both
machines so that's not an issue. Anyway, thank you very much for your
suggestion of using system("hostname"). This does indeed work nicely and
provides an excellent workaround for this annoying issue. It still
doesn't explain, though, why it is there at all. Puzzling.
Thanks again,
--Helmut
PS: This not only happens with the pdf terminal (which I understand
shouldn't be used anymore), but also with pdfcairo.
On 10/26/2020 3:55 AM, Alexander Stangl wrote:
> Hey,
>
> there might be also the fontscale parameter. But not sure why this
> should be different on different machines (if you use the same
> initialisation)
> A work around could be to read out the computer name and depending on
> this you set the terminal automatically to font size 6 or 12,
> e.g.:
> if(system("hostname") eq "PC1") { font = 12}
> else { font = 6}
> set terminal pdf font "Times-New-Roman,".font
>
> Best,
> Alex
>
> On Sat, 17 Oct 2020 at 17:11, Helmut Haberzettl <he...@ha...
> <mailto:he...@ha...>> wrote:
>
> Hi,
>
> I use gnuplot 5.2 (patchlevel 8) on various machines running
> Windows 10 Pro.
>
> When creating plots using the pdf terminal, the font sizes come out
> differently on different machines. Specifically, while
> set terminal pdf font "Times-New-Roman,12"
> works as expected on one machine, I need to use
> set terminal pdf font "Times-New-Roman,6"
> on another machine to produce approximately (but not identically) the
> same output on another machine. The plot files are identical
> otherwise.
>
> Are there some additional settings I'm unaware of that prevent
> this from
> happening? This is quite annoying because I frequently work on the
> same
> gnuplot file switching between machines (desktop, laptop) and any
> help
> in this regard would be greatly appreciated.
>
> Thank you,
> --Helmut Haberzettl
>
>
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> <mailto:gnu...@li...>
> Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
> <https://lists.sourceforge.net/lists/listinfo/gnuplot-info>
>
|
|
From: Robert v. K. <bo...@en...> - 2020-12-03 11:15:11
|
Yes, I obviously overlooked that, sorry. My plots are now working great and I'm getting lots of information from my data. Again, many thanks Alex, LG, Bob On 03/12/2020 12:02, Alexander Stangl wrote: > As commented previously you need to filter out also the points when you > define the y value. > So it should read: > file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1,NaN) : int($0)%4 == 3 ? $1/y > : NaN) title "rr100/rr25" ls 9 > > like this it will plot NaN every 1st, 2nd and 4th line of your four line > data block and for line 3 it plots the data from line3 divided by data > from line 1. > > Best, > Alex > > On Thu, 3 Dec 2020 at 11:36, Robert von Knobloch <bo...@en... > <mailto:bo...@en...>> wrote: > > Oh dear! I wrote a little too soon Alex, sorry. > The trace looks OK at first and then I realised that it had more > plotted > points that the number of data samples (twice as many). These are > positioned at the integer points of samples on the X axis and also > erroneously at 1/3 of the distance between these points. (So at X = 1, > 1.33, 2 etc..) > I cannot see where these points come from , any ideas? > > LG, > > Bob > > > On 02/12/2020 17:00, Alexander Stangl wrote: > >> Das sollte jetzt klappen: > >> statt using 0:... musst du using (($0-3)/4):... verwenden. Dann > plottest > >> du die daten gleich wie die anderen. > >> > >> LG > > > > Alexander, your solution works perfectly. > > Again, many thanks for your efforts. > > My knowledge of gnuplot is not as deep as yours. > > > > I'll post to the list as the topic is closed. > > Bob (Robert) von Knobloch. > > > > Solution: > > > > set datafile missing NaN > > y=NaN > > plot file1 every 4::0 using 1 title "rr25" ls 1, \ > > file1 every 4::1 using 1 title "rr50" ls 3, \ > > file1 every 4::2 using 1 title "rr75" ls 5, \ > > file1 every 4::3 using 1 title "rr100" ls 7, \ > > file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1) : int($0)%4 > == 3 ? $1/y > > : NaN) title "rr100/rr25" ls 9 > > > > > > _______________________________________________ > > gnuplot-info mailing list > > gnu...@li... > <mailto:gnu...@li...> > > Membership management via: > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > <https://lists.sourceforge.net/lists/listinfo/gnuplot-info> > > > |
|
From: Alexander S. <ma...@st...> - 2020-12-03 11:02:48
|
As commented previously you need to filter out also the points when you define the y value. So it should read: file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1,NaN) : int($0)%4 == 3 ? $1/y : NaN) title "rr100/rr25" ls 9 like this it will plot NaN every 1st, 2nd and 4th line of your four line data block and for line 3 it plots the data from line3 divided by data from line 1. Best, Alex On Thu, 3 Dec 2020 at 11:36, Robert von Knobloch <bo...@en...> wrote: > Oh dear! I wrote a little too soon Alex, sorry. > The trace looks OK at first and then I realised that it had more plotted > points that the number of data samples (twice as many). These are > positioned at the integer points of samples on the X axis and also > erroneously at 1/3 of the distance between these points. (So at X = 1, > 1.33, 2 etc..) > I cannot see where these points come from , any ideas? > > LG, > > Bob > > > On 02/12/2020 17:00, Alexander Stangl wrote: > >> Das sollte jetzt klappen: > >> statt using 0:... musst du using (($0-3)/4):... verwenden. Dann plottest > >> du die daten gleich wie die anderen. > >> > >> LG > > > > Alexander, your solution works perfectly. > > Again, many thanks for your efforts. > > My knowledge of gnuplot is not as deep as yours. > > > > I'll post to the list as the topic is closed. > > Bob (Robert) von Knobloch. > > > > Solution: > > > > set datafile missing NaN > > y=NaN > > plot file1 every 4::0 using 1 title "rr25" ls 1, \ > > file1 every 4::1 using 1 title "rr50" ls 3, \ > > file1 every 4::2 using 1 title "rr75" ls 5, \ > > file1 every 4::3 using 1 title "rr100" ls 7, \ > > file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1) : int($0)%4 == 3 ? > $1/y > > : NaN) title "rr100/rr25" ls 9 > > > > > > _______________________________________________ > > gnuplot-info mailing list > > gnu...@li... > > Membership management via: > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > > > |
|
From: Robert v. K. <bo...@en...> - 2020-12-03 10:36:15
|
Oh dear! I wrote a little too soon Alex, sorry. The trace looks OK at first and then I realised that it had more plotted points that the number of data samples (twice as many). These are positioned at the integer points of samples on the X axis and also erroneously at 1/3 of the distance between these points. (So at X = 1, 1.33, 2 etc..) I cannot see where these points come from , any ideas? LG, Bob > On 02/12/2020 17:00, Alexander Stangl wrote: >> Das sollte jetzt klappen: >> statt using 0:... musst du using (($0-3)/4):... verwenden. Dann plottest >> du die daten gleich wie die anderen. >> >> LG > > Alexander, your solution works perfectly. > Again, many thanks for your efforts. > My knowledge of gnuplot is not as deep as yours. > > I'll post to the list as the topic is closed. > Bob (Robert) von Knobloch. > > Solution: > > set datafile missing NaN > y=NaN > plot file1 every 4::0 using 1 title "rr25" ls 1, \ > file1 every 4::1 using 1 title "rr50" ls 3, \ > file1 every 4::2 using 1 title "rr75" ls 5, \ > file1 every 4::3 using 1 title "rr100" ls 7, \ > file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1) : int($0)%4 == 3 ? $1/y > : NaN) title "rr100/rr25" ls 9 > > > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |
|
From: Robert v. K. <bo...@en...> - 2020-12-03 08:21:35
|
On 02/12/2020 17:00, Alexander Stangl wrote: > Das sollte jetzt klappen: > statt using 0:... musst du using (($0-3)/4):... verwenden. Dann plottest > du die daten gleich wie die anderen. > > LG Alexander, your solution works perfectly. Again, many thanks for your efforts. My knowledge of gnuplot is not as deep as yours. I'll post to the list as the topic is closed. Bob (Robert) von Knobloch. Solution: set datafile missing NaN y=NaN plot file1 every 4::0 using 1 title "rr25" ls 1, \ file1 every 4::1 using 1 title "rr50" ls 3, \ file1 every 4::2 using 1 title "rr75" ls 5, \ file1 every 4::3 using 1 title "rr100" ls 7, \ file1 using (($0-3)/4):(int($0)%4 == 0 ? (y=$1) : int($0)%4 == 3 ? $1/y : NaN) title "rr100/rr25" ls 9 |
|
From: Alexander S. <ma...@st...> - 2020-12-02 14:23:04
|
"set datafile missing NaN" should do the trick and here's a small edit: (int($0)%4 == 0 ? (y=$1,NaN) : int($0)%4 == 3 ? y/$1 : NaN) else it would plot datum#1 every 4th line (starting first line) and datum#1/datum#3 every 4th line (starting from the third line). Cheers, Alex On Wed, 2 Dec 2020 at 14:21, Robert von Knobloch <bo...@en...> wrote: > On 01/12/2020 16:29, Alexander Stangl wrote: > > Hey, > > > > what about: > > > > y=NaN > > plot file1 every 4::0 using 1 title "25" ls 1, \ > > file1 every 4::1 using 1 title "50" ls 3, \ > > file1 every 4::2 using 1 title "75" ls 5, \ > > file1 every 4::3 using 1 title "100" ls 7, \ > > file1 u 0:(int($0)%4==0 ? y=$1 : int($0)%4==2 ? $1*y : NaN) t > > "50*100" > > > > Best, > > Alex > > > > Hi Alex, thanks for the code. > It did not produce a visible plot for me, so I adjusted it a wee bit: > > y=NaN > plot file1 every 4::0 using 1 title "rr25" ls 1, \ > file1 every 4::1 using 1 title "rr50" ls 3, \ > file1 every 4::2 using 1 title "rr75" ls 5, \ > file1 every 4::3 using 1 title "rr100" ls 7, \ > file1 using 0:(int($0)%4 == 0 ? y=$1 : int($0)%4 == 3 ? y/$1 : > NaN) > title "rr100/rr50" ls 9 > > I'm dividing, not multiplying but the result is the same: > > small pieces of plot trace between each 3rd and 0th (4th) entry the > endpoints of these pieces don't seem to bear any numerical relationship > to the data. > Small picture attached, also to your direct mail as I think the list may > not support pictures. > > I think I see the logic of your suggestion and cannot see any reason why > it should not work (from reading the Gnuplot docs). > > Many thanks for your time, > > Bob > |