gnuplot-info

 [Gnuplot-info] depth in gnuplot? From: Luiz Fernando C Camargo - 2006-04-08 23:30:14 Hello, I'm new to the List and a new gnuplot user as well. I hope you don't mind my asking this beginner's question. Here it goes: I am trying to make a plot of the region in xy-plane bounded by the curves x=-y^2, x-y=4, y=-1 and y=2. This is what I got so far: set trange [-1:2] set xrange [-5:7] set yrange [-2:3] unset key set size 1,1 set origin 0,0 set multiplot set size 1,1 set origin 0,0 plot 2 lt -1, -1 lt -1, sqrt(-x) lt -1, -sqrt(-x) lt -1, x-4 lt -1 set size 1,1 set origin 0,0 set parametric plot -t**2, t lt 5 with filledcu y2, t+4, t lt -2 with filledcu y2 unset multiplot reset It took me the whole afternoon to come up with this ;) The problem is I can't see distinctly and completely the lines that make up the boundary of the region. What be done? is there anything such as depth as in xfig or is there an easier way to achieve this? I will appreciate any help. Thanks, Luiz Fernando
 Re: [Gnuplot-info] depth in gnuplot? From: - 2006-04-09 12:18:36 Luiz Fernando C Camargo wrote: [...] > set multiplot > set size 1,1 > set origin 0,0 > plot 2 lt -1, -1 lt -1, sqrt(-x) lt -1, -sqrt(-x) lt -1, x-4 lt -1 > set size 1,1 > set origin 0,0 > set parametric > plot -t**2, t lt 5 with filledcu y2, t+4, t lt -2 with filledcu y2 > unset multiplot Using multiplot like this is almost never a good idea. > The problem is I can't see distinctly and completely the lines that > make up the boundary of the region. What be done? Change the order of plotting. Make all plots parametric, and do the 'filledcurves" ones *first*. gnuplot draws all the functions and datasets you hand it in the given order, so what you draw later will overprint what was drawn earlier.
 [Gnuplot-info] Re: depth in gnuplot? From: Luiz Fernando C Camargo - 2006-04-09 22:08:53 Hans-Bernhard Bröker wrote: > Change the order of plotting. Make all plots parametric, and do > the 'filledcurves" ones *first*. gnuplot draws all the functions > and datasets you hand it in the given order, so what you draw > later will overprint what was drawn earlier. OK, problem is solved, thank you very much. Now please, take a look at this modified code: set xrange [-5:7] set yrange [-2:3] unset key set parametric set trange [-1:2] set label "R" at -1, 1.5 front set style line 1 lt -1 lw 1.5 plot -t**2, t lt 5 with filledcu y2, t+4, t lt -2 with filledcu y2, \ -((5*t-1)/3)**2, (5*t-1)/3 ls 1 with lines, \ (5*t-1)/3+4, (5*t-1)/3 ls 1 with lines, \ 4*t-1, 2 ls 1 with lines, 4*t-1,-1 ls 1 with lines set zeroaxis I had to append the option 'front' to the 'set label' command for, otherwise, the label would be underneath the colored region and wouldn't be visible. Now, I don't have a similar option for the 'set zeroaxis' command. Only part of the xzeroaxis and of the yzeroaxis are visible, what can I do in this case? Thank you very much. Luiz Fernando
 Re: [Gnuplot-info] Re: depth in gnuplot? From: - 2006-04-11 11:35:43 Luiz Fernando C Camargo wrote: > set xrange [-5:7] > set yrange [-2:3] > unset key > set parametric > set trange [-1:2] > set label "R" at -1, 1.5 front > set style line 1 lt -1 lw 1.5 > plot -t**2, t lt 5 with filledcu y2, t+4, t lt -2 with filledcu y2, \ > -((5*t-1)/3)**2, (5*t-1)/3 ls 1 with lines, \ > (5*t-1)/3+4, (5*t-1)/3 ls 1 with lines, \ > 4*t-1, 2 ls 1 with lines, 4*t-1,-1 ls 1 with lines > set zeroaxis > > I had to append the option 'front' to the 'set label' command for, > otherwise, the label would be underneath the colored region and > wouldn't be visible. Now, I don't have a similar option for the 'set > zeroaxis' command. Only part of the xzeroaxis and of the yzeroaxis > are visible, what can I do in this case? The same thing, really: fix the order of commands. "set" commands in gnuplot are settings, not actions, i.e. they don't draw anything by themselves. To be effective, they have to be given *before* the 'plot' command.
 [Gnuplot-info] Re: Re: depth in gnuplot? From: Luiz Fernando C Camargo - 2006-04-11 14:56:26 Hans-Bernhard Bröker wrote: > Luiz Fernando C Camargo wrote: > >> set xrange [-5:7] >> set yrange [-2:3] >> unset key >> set parametric >> set trange [-1:2] >> set label "R" at -1, 1.5 front >> set style line 1 lt -1 lw 1.5 >> plot -t**2, t lt 5 with filledcu y2, t+4, t lt -2 with filledcu y2, \ >> -((5*t-1)/3)**2, (5*t-1)/3 ls 1 with lines, \ >> (5*t-1)/3+4, (5*t-1)/3 ls 1 with lines, \ >> 4*t-1, 2 ls 1 with lines, 4*t-1,-1 ls 1 with lines >> set zeroaxis >> >> I had to append the option 'front' to the 'set label' command for, >> otherwise, the label would be underneath the colored region and >> wouldn't be visible. Now, I don't have a similar option for the 'set >> zeroaxis' command. Only part of the xzeroaxis and of the yzeroaxis >> are visible, what can I do in this case? > > The same thing, really: fix the order of commands. "set" commands in > gnuplot are settings, not actions, i.e. they don't draw anything by > themselves. To be effective, they have to be given *before* the 'plot' > command. All right, but... even if the 'set zeroaxis' command is given before the 'plot' command, like this, set xrange [-5:7] set yrange [-2:3] unset key set parametric set trange [-1:2] set label "R" at -1, 1.5 front set style line 1 lt -1 lw 1.5 set zeroaxis plot -t**2, t lt 5 with filledcu y2, t+4, t lt -2 with filledcu y2, \ -((5*t-1)/3)**2, (5*t-1)/3 ls 1 with lines, \ (5*t-1)/3+4, (5*t-1)/3 ls 1 with lines, \ 4*t-1, 2 ls 1 with lines, 4*t-1,-1 ls 1 with lines even then the axes are only partially visible...