|
From: Ethan A M. <eam...@gm...> - 2016-08-24 03:47:44
|
On Wednesday, 24 August 2016 10:17:15 AM you wrote:
> Dear Ethan,
> I successfully installed gnuplot 5.0.4 on win7 (a bit hard for me to upgrade gnuplot on my Ubuntu14.04), and plot the figure using your script. That is very helpful. And thank you very much!
> I still have two questions. Could please help me?
> The first one is, it seems the lines represent different Nd values (Y aixs) have the same color, it is possible to let them show different colors?
# column(-1) returns the index of the block of data in the file.
# see "help pseudocolumns"
# The index starts at 0 so we add 1 in order to use line colors 1 to N
# lc variable says use the color of linetype N where N is the index of the block.
#
splot '3dtest.txt' using 1:2:3:(1 + column(-1)) with lines linewidth 3 lc variable
> The second one is, is that possible to plot error bars on z axis if I add one column on the text file (the second attachment)?
# There is no "with errorbars" style for 3D plots so we have to draw two plots
# The first one draws the lines as before
# The second draws an errorbar with length +/- column(4) value at each point
#
set style arrow 1 linecolor black heads size 0.2, 90
splot '3dtest.txt' using 1:2:3:(1 + column(-1)) with lines linewidth 3 lc variable, \
'3dtest.txt' using 1:2:($3-$4):(0):(0):(2*$4) with vectors arrowstyle 1
Ethan
> Any help would be much appreciated!
>
> Best Regards
> Liu
>
>
>
>
> 发件人:Ethan A Merritt <eam...@gm...>
> 发送时间:2016-08-22 22:55
> 主题:Re: [Gnuplot-info] Dear everyone, could you please help me on how to plot a picture like the attachment? Thanks!
> 收件人:"Wenqiang Liu"<liu...@16...>
> 抄送:"gnuplot-info"<gnu...@li...>,"Craig DeForest"<def...@bo...>
>
> On Monday, 22 August 2016 03:23:54 PM Wenqiang Liu wrote:
> > Dear Ethan,
> > Thanks very much! Your pdf file looks like what I trying to plot.
> > However, when I load your script, an error message shown, which is
> > "3dtest.gp", line 13: ';' expected
> > My gnuplot version is gnuplot 4.6 patchlevel 4.
>
> The full error message includes a pointer to the command that was
> not recognized:
>
> set surface explicit
> ^
> "3dtest.gp", line 13: ';' expected
>
> > Could you please tell me how to fix this problem?
>
> Apparently that command is more recent than version 4.6.
> It was introduced to solve exactly the problem you are having,
> "only connect lines into a surface if the command explicitly says
> to plot with surface".
>
> I think the best option is to update to gnuplot version 5.
> I do not recall if there was a work-around in earlier versions.
> Maybe someone else remembers.
>
> Ethan
>
>
>
> > Best Regards
> > Liu
> >
> >
> >
> >
> > 发件人:Ethan A Merritt <eam...@gm...>
> > 发送时间:2016-08-22 12:17
> > 主题:Re: [Gnuplot-info] Dear everyone, could you please help me on how to plot a picture like the attachment? Thanks!
> > 收件人:"Wenqiang Liu"<liu...@16...>
> > 抄送:"gnuplot-info"<gnu...@li...>,"Craig DeForest"<def...@bo...>
> >
> > On Monday, 22 August 2016 10:01:26 AM Wenqiang Liu wrote:
> > > Dear Ethan,
> > > I followed your answer and tried to plot my figure.
> > > My original file is 3dtest.txt which is a text file as the first attachment. And then I used splot "3dtest.txt" u 2:1:3 with lines to plot. The generated figure is the same as 3dtest.eps, which is the second attachment.
> > > I found there are lines between X axis and Y axis. But I do not want them.
> > > I think I am approaching my goal, however, there are still some modifications needed.
> > > Could you please give me some more instructions?
> > > Any help would be much appreciated!
> > >
> > > Best Regards
> > > Liu
> >
> > # plot layout
> > set xyplane at 0
> > set grid x y z
> > set border 0x37F
> > unset key
> >
> > # axis and tic labels
> > set format x "%.2g keV"
> > set ytics offset 0, -1 # move ytics down
> > set ylabel "Time (ps)" offset 0,-2 # move y label down
> > set xrange [0.0 : 0.25]
> >
> > # orientation
> > set view 70, 100
> >
> > # plot command
> > set surface explicit
> > splot '3dtest.txt' using 1:2:3 with lines linewidth 3
> > [attachment]
> >
> > 3dtest.gp
> > download: http://u.163.com/t0/SuCVfmvp
> >
> >
> > 3dtest.pdf
> > download: http://u.163.com/t0/kQrkY2ayKWq2
> >
> > preview: http://u.163.com/t0/W7OKjcijtc
|