Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #3227 > unrolled thread
| Started by | kunrooney@gmail.com |
|---|---|
| First post | 2016-02-11 22:23 -0800 |
| Last post | 2016-02-12 08:38 +0100 |
| Articles | 5 — 4 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
X-axis display! kunrooney@gmail.com - 2016-02-11 22:23 -0800
Re: X-axis display! Jörg Buchholz <bookwood4new@freenet.de> - 2016-02-12 08:33 +0100
Re: X-axis display! Kaustubh Nabar <kunrooney@gmail.com> - 2016-02-11 23:43 -0800
Re: X-axis display! Kaustubh Nabar <kunrooney@gmail.com> - 2016-02-11 23:54 -0800
Re: X-axis display! Karl Ratzsch <mail.kfr@gmx.net> - 2016-02-12 08:38 +0100
| From | kunrooney@gmail.com |
|---|---|
| Date | 2016-02-11 22:23 -0800 |
| Subject | X-axis display! |
| Message-ID | <1e9ccb7d-a448-43e0-9afe-85b435c77042@googlegroups.com> |
My two files are:
0.4 95.1
0.8 94.9
1.2 92.2
1.6 91.6
2.0 89.7
0.4 111.8
0.8 110.9
1.2 108.2
1.6 105.6
2.0 104.7
My gnuplot code is
set terminal png
set output 'test.png'
set timefmt "%S"
set key top left
set xdata time
set format x "%f"
set autoscale
set format y "%.f"
set xr [0.4:2.0]
set yr [85:115]
set grid
set style data linespoints
plot "1.txt" using 1:2 lw 1.5 pt 3 title 'Sample1',\
"2.txt" using 1:2 lw 1.5 pt 4 title 'Sample2',\
The y-axis is fine but on x-axis i am getting display like this:
00:00 00:00 00:01 instead of 0.4, 0.8, 1.2 etc.
[toc] | [next] | [standalone]
| From | Jörg Buchholz <bookwood4new@freenet.de> |
|---|---|
| Date | 2016-02-12 08:33 +0100 |
| Message-ID | <n9k1lu$52u$1@dont-email.me> |
| In reply to | #3227 |
On 12.02.2016 07:23, kunrooney@gmail.com wrote: > My two files are: > 0.4 95.1 > 0.8 94.9 > 1.2 92.2 > 1.6 91.6 > 2.0 89.7 > > 0.4 111.8 > 0.8 110.9 > 1.2 108.2 > 1.6 105.6 > 2.0 104.7 > > My gnuplot code is > set terminal png > set output 'test.png' > set timefmt "%S" > set key top left > set xdata time > set format x "%f" > set autoscale > set format y "%.f" > set xr [0.4:2.0] > set yr [85:115] > set grid > set style data linespoints > > plot "1.txt" using 1:2 lw 1.5 pt 3 title 'Sample1',\ > "2.txt" using 1:2 lw 1.5 pt 4 title 'Sample2',\ > > > The y-axis is fine but on x-axis i am getting display like this: > 00:00 00:00 00:01 instead of 0.4, 0.8, 1.2 etc. > You set xdata time, don't do this if you don't want timeformat. "set format x "%f"" there is a missing point, use "set format x "%.f"" Jörg
[toc] | [prev] | [next] | [standalone]
| From | Kaustubh Nabar <kunrooney@gmail.com> |
|---|---|
| Date | 2016-02-11 23:43 -0800 |
| Message-ID | <84345103-9c48-4421-8ea2-0fcfaf277565@googlegroups.com> |
| In reply to | #3228 |
On Friday, February 12, 2016 at 1:03:03 PM UTC+5:30, Jörg Buchholz wrote: > On 12.02.2016 07:23, kunrooney@gmail.com wrote: > > My two files are: > > 0.4 95.1 > > 0.8 94.9 > > 1.2 92.2 > > 1.6 91.6 > > 2.0 89.7 > > > > 0.4 111.8 > > 0.8 110.9 > > 1.2 108.2 > > 1.6 105.6 > > 2.0 104.7 > > > > My gnuplot code is > > set terminal png > > set output 'test.png' > > set timefmt "%S" > > set key top left > > set xdata time > > set format x "%f" > > set autoscale > > set format y "%.f" > > set xr [0.4:2.0] > > set yr [85:115] > > set grid > > set style data linespoints > > > > plot "1.txt" using 1:2 lw 1.5 pt 3 title 'Sample1',\ > > "2.txt" using 1:2 lw 1.5 pt 4 title 'Sample2',\ > > > > > > The y-axis is fine but on x-axis i am getting display like this: > > 00:00 00:00 00:01 instead of 0.4, 0.8, 1.2 etc. > > > You set xdata time, don't do this if you don't want timeformat. > "set format x "%f"" there is a missing point, use "set format x "%.f"" > > Jörg I deleted the set xdata time and also added the missing point. But now the display which i am getting on x-axis is: 0, 0, 0, 1, 1, 1, 2, 2
[toc] | [prev] | [next] | [standalone]
| From | Kaustubh Nabar <kunrooney@gmail.com> |
|---|---|
| Date | 2016-02-11 23:54 -0800 |
| Message-ID | <9332d93e-4ccd-4f10-8586-a9c35b31d5f9@googlegroups.com> |
| In reply to | #3230 |
On Friday, February 12, 2016 at 1:13:22 PM UTC+5:30, Kaustubh Nabar wrote:
> On Friday, February 12, 2016 at 1:03:03 PM UTC+5:30, Jörg Buchholz wrote:
> > On 12.02.2016 07:23, kunrooney@gmail.com wrote:
> > > My two files are:
> > > 0.4 95.1
> > > 0.8 94.9
> > > 1.2 92.2
> > > 1.6 91.6
> > > 2.0 89.7
> > >
> > > 0.4 111.8
> > > 0.8 110.9
> > > 1.2 108.2
> > > 1.6 105.6
> > > 2.0 104.7
> > >
> > > My gnuplot code is
> > > set terminal png
> > > set output 'test.png'
> > > set timefmt "%S"
> > > set key top left
> > > set xdata time
> > > set format x "%f"
> > > set autoscale
> > > set format y "%.f"
> > > set xr [0.4:2.0]
> > > set yr [85:115]
> > > set grid
> > > set style data linespoints
> > >
> > > plot "1.txt" using 1:2 lw 1.5 pt 3 title 'Sample1',\
> > > "2.txt" using 1:2 lw 1.5 pt 4 title 'Sample2',\
> > >
> > >
> > > The y-axis is fine but on x-axis i am getting display like this:
> > > 00:00 00:00 00:01 instead of 0.4, 0.8, 1.2 etc.
> > >
> > You set xdata time, don't do this if you don't want timeformat.
> > "set format x "%f"" there is a missing point, use "set format x "%.f""
> >
> > Jörg
>
> I deleted the set xdata time and also added the missing point. But now the display which i am getting on x-axis is:
> 0, 0, 0, 1, 1, 1, 2, 2
THANK YOU Jörg and Karl, Finally the following code worked:
set terminal png
set output 'test.png'
set key top right
set format x "%.1f" numeric
set autoscale
set format y "%.f"
set xr [0.4:2.0]
set yr [85:115]
set grid
set style data linespoints
plot "1.txt" using 1:2 lw 1.5 pt 3 title 'Sample1',\
"2.txt" using 1:2 lw 1.5 pt 4 title 'Sample2',\
[toc] | [prev] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2016-02-12 08:38 +0100 |
| Message-ID | <n9k24r$mvc$1@solani.org> |
| In reply to | #3227 |
Am 12.02.2016 um 07:23 schrieb kunrooney@gmail.com: > My two files are: > 0.4 95.1 > 0.8 94.9 > 1.2 92.2 > 1.6 91.6 > 2.0 89.7 > set timefmt "%S" > set xdata time > set format x "%f" > > The y-axis is fine but on x-axis i am getting display like this: > 00:00 00:00 00:01 instead of 0.4, 0.8, 1.2 etc. > "set format x "%f" numeric" (>gp5.0) should help, as would removing "xdata time". As you don't have any time format like HH:MM:SS, you don't need to bother. Karl
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web