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
(3) |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(2) |
2
(1) |
3
(4) |
4
(1) |
5
|
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
|
27
|
28
(4) |
29
(2) |
30
(3) |
31
|
|
|
|
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 > |
|
From: Alexander S. <ma...@st...> - 2020-12-01 15:55:52
|
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
On Tue, 1 Dec 2020 at 15:18, Robert von Knobloch <bo...@en...> wrote:
> Hi,
> I am plotting groups of 4 lines of data.
> I can plot the first datum of each line using:
>
> 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
>
> Which works fine for the whole file of 50 or so entries
>
> What I would like to be able to do is to add a computed line e.g. the
> result of datum#1 in the first of the 4 block multiplied by datum#1 of
> the third block (for the whole file).
>
> Is there a method of doing this?
>
> Regards,
> Robert von Knobloch
>
>
> _______________________________________________
> 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-01 14:17:42
|
Hi, I am plotting groups of 4 lines of data. I can plot the first datum of each line using: 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 Which works fine for the whole file of 50 or so entries What I would like to be able to do is to add a computed line e.g. the result of datum#1 in the first of the 4 block multiplied by datum#1 of the third block (for the whole file). Is there a method of doing this? Regards, Robert von Knobloch |