|
From: Paulo J. M. <poc...@gm...> - 2011-03-28 14:19:10
|
Hi, I have the following: data.dat 1000 5 1500 4 1750 9 data1.dat 1200 2 1550 8 1600 6 I want to plot data.dat as a line and data1 as points. However, I want the xtics to be equally spaced. So, 1000 should be further from 1200 than 1500 from 1550. I have tried: set xtics (1000 1, 1200 2, 1500 3, 1550 4, 1600 5, 1750 6) plot 'data.dat' using 2:xtic(1) with linespoints, 'data1.dat' using 2:xtic(1) with points but to no avail. Any tips on how to get this done? Cheers, -- PMatos |
|
From: Thomas S. <t.s...@fz...> - 2011-03-28 15:37:13
|
add the column with the x-values to the 'using' option: plot 'data.dat' using 1:2:xtic(1) with linespoints, \ 'data1.dat' using 1:2:xtic(1) with point Paulo J. Matos wrote: > > Hi, > > I have the following: > data.dat > 1000 5 > 1500 4 > 1750 9 > > data1.dat > 1200 2 > 1550 8 > 1600 6 > > I want to plot data.dat as a line and data1 as points. > However, I want the xtics to be equally spaced. So, 1000 should be > further from 1200 than 1500 from 1550. > > I have tried: > set xtics (1000 1, 1200 2, 1500 3, 1550 4, 1600 5, 1750 6) > plot 'data.dat' using 2:xtic(1) with linespoints, 'data1.dat' using > 2:xtic(1) with points > > but to no avail. > > Any tips on how to get this done? > > Cheers, > -- > PMatos > > > ------------------------------------------------------------------------------ > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/lines-and-points-from-discrete-data-tp31258709p31259483.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2011-03-28 19:51:40
|
On 28.03.2011 16:18, Paulo J. Matos wrote: > I have tried: > set xtics (1000 1, 1200 2, 1500 3, 1550 4, 1600 5, 1750 6) > plot 'data.dat' using 2:xtic(1) with linespoints, 'data1.dat' using > 2:xtic(1) with points Looks like you're trying way too hard. From what you said you wanted, a much simpler plot 'data.dat' u 1:2 w lp, 'data1.dat' u 1:2 w p would have fit the bill. |
|
From: Paulo J. M. <poc...@gm...> - 2011-03-28 20:31:57
|
Hi, thanks very much. The problem with that solution is that it doesn't meet the following requirement: "However, I want the xtics to be equally spaced. So, 1000 should be further from 1200 than 1500 from 1550." So, for example, only the tics for 1000, 1200, 1500, 1550, 1600 and 1750 should show up. Then the line graph for data.dat would have a point in 1000, 1500 and 1750. There would then be 3 points for data1.dat in 1550, 1600 and 1750. I am sorry if I wasn't initially very explicit. Cheers, -- PMatos 2011/3/28 Hans-Bernhard Bröker <HBB...@t-...>: > On 28.03.2011 16:18, Paulo J. Matos wrote: > >> I have tried: >> set xtics (1000 1, 1200 2, 1500 3, 1550 4, 1600 5, 1750 6) >> plot 'data.dat' using 2:xtic(1) with linespoints, 'data1.dat' using >> 2:xtic(1) with points > > Looks like you're trying way too hard. From what you said you wanted, a > much simpler > > plot 'data.dat' u 1:2 w lp, 'data1.dat' u 1:2 w p > > would have fit the bill. > -- PMatos |
|
From: Paulo J. M. <poc...@gm...> - 2011-03-28 20:50:39
|
Thanks to Hans who just pointed out that I wrote my requirements incorrectly. What I meant was: "However, I want the xtics to be equally spaced. So, 1000 should be _not_ further from 1200 than 1500 from 1550. 2011/3/28 Paulo J. Matos <poc...@gm...>: > Hi, thanks very much. > > The problem with that solution is that it doesn't meet the following > requirement: > "However, I want the xtics to be equally spaced. So, 1000 should be > further from 1200 than 1500 from 1550." > > So, for example, only the tics for 1000, 1200, 1500, 1550, 1600 and > 1750 should show up. > Then the line graph for data.dat would have a point in 1000, 1500 and > 1750. There would then be 3 points for data1.dat in 1550, 1600 and > 1750. > > I am sorry if I wasn't initially very explicit. > > Cheers, > > -- > PMatos > > 2011/3/28 Hans-Bernhard Bröker <HBB...@t-...>: >> On 28.03.2011 16:18, Paulo J. Matos wrote: >> >>> I have tried: >>> set xtics (1000 1, 1200 2, 1500 3, 1550 4, 1600 5, 1750 6) >>> plot 'data.dat' using 2:xtic(1) with linespoints, 'data1.dat' using >>> 2:xtic(1) with points >> >> Looks like you're trying way too hard. From what you said you wanted, a >> much simpler >> >> plot 'data.dat' u 1:2 w lp, 'data1.dat' u 1:2 w p >> >> would have fit the bill. >> > > > > -- > PMatos > -- PMatos |
|
From: BBands <bb...@gm...> - 2011-03-28 21:12:28
|
Maybe I am misunderstanding, but gnuplot offers very powerful control
over tics and labeling. See help set xtics. This is sort of a common
problem in finance where we want trading days to be equidistant, not
calendar days. There is a simple example in my finance demo in the
demos directory.
John
|
|
From: Thomas S. <t.s...@fz...> - 2011-03-29 18:54:38
|
so you want to mix the data of the two files, this can be done by using the pseudocolumn "0": plot 'data.dat' using ($0*2):2:xtic(1) with linespoints, \ 'data1.dat' using ($0*2+1):2:xtic(1) with points Paulo J. Matos wrote: > > Thanks to Hans who just pointed out that I wrote my requirements > incorrectly. What I meant was: > "However, I want the xtics to be equally spaced. So, 1000 should be _not_ > further from 1200 than 1500 from 1550. > > 2011/3/28 Paulo J. Matos <poc...@gm...>: >> Hi, thanks very much. >> >> The problem with that solution is that it doesn't meet the following >> requirement: >> "However, I want the xtics to be equally spaced. So, 1000 should be >> further from 1200 than 1500 from 1550." >> >> So, for example, only the tics for 1000, 1200, 1500, 1550, 1600 and >> 1750 should show up. >> Then the line graph for data.dat would have a point in 1000, 1500 and >> 1750. There would then be 3 points for data1.dat in 1550, 1600 and >> 1750. >> >> I am sorry if I wasn't initially very explicit. >> >> Cheers, >> >> -- >> PMatos >> >> 2011/3/28 Hans-Bernhard Bröker <HBB...@t-...>: >>> On 28.03.2011 16:18, Paulo J. Matos wrote: >>> >>>> I have tried: >>>> set xtics (1000 1, 1200 2, 1500 3, 1550 4, 1600 5, 1750 6) >>>> plot 'data.dat' using 2:xtic(1) with linespoints, 'data1.dat' using >>>> 2:xtic(1) with points >>> >>> Looks like you're trying way too hard. From what you said you wanted, a >>> much simpler >>> >>> plot 'data.dat' u 1:2 w lp, 'data1.dat' u 1:2 w p >>> >>> would have fit the bill. >>> >> >> >> >> -- >> PMatos >> > > > > -- > PMatos > > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and publish > your website. http://p.sf.net/sfu/ms-webmatrix-sf > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/lines-and-points-from-discrete-data-tp31258709p31270536.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Paulo J. M. <poc...@gm...> - 2011-03-31 10:34:28
|
On 29/03/11 19:54, Thomas Sefzick wrote: > > so you want to mix the data of the two files, this can be > done by using the pseudocolumn "0": > > plot 'data.dat' using ($0*2):2:xtic(1) with linespoints, \ > 'data1.dat' using ($0*2+1):2:xtic(1) with points > > Thanks Thomas, I don't know why that works but it does!!! |