Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1644 > unrolled thread

Setting line width increases line length

Started by"Ivan K." <ivan_521521@yahoo.com>
First post2013-02-17 18:03 -0800
Last post2013-02-18 11:17 -0800
Articles 7 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Setting line width increases line length "Ivan K." <ivan_521521@yahoo.com> - 2013-02-17 18:03 -0800
    Re: Setting line width increases line length sfeam <sfeam@users.sourceforge.net> - 2013-02-18 10:23 -0800
      Re: Setting line width increases line length "Ivan K." <ivan_521521@yahoo.com> - 2013-02-18 10:33 -0800
        Re: Setting line width increases line length "Ivan K." <ivan_521521@yahoo.com> - 2013-02-18 10:51 -0800
        Re: Setting line width increases line length sfeam <sfeam@users.sourceforge.net> - 2013-02-18 11:05 -0800
          Re: Setting line width increases line length "Ivan K." <ivan_521521@yahoo.com> - 2013-02-18 11:12 -0800
            Re: Setting line width increases line length "Ivan K." <ivan_521521@yahoo.com> - 2013-02-18 11:17 -0800

#1644 — Setting line width increases line length

From"Ivan K." <ivan_521521@yahoo.com>
Date2013-02-17 18:03 -0800
SubjectSetting line width increases line length
Message-ID<e53ae783-893f-4261-bd80-f9f1f19da0ce@u7g2000yqg.googlegroups.com>
Appended below are a command file and two simple data files
which illustrate a problem that I am having with
setting the width of a plotted line.

In the example, both lines begin at x=10
and end at x=20.

However, in the top line, I have set the line
width to "7" but not only does this increase
the width of the line (something I want)
but increasing the width increases the _length_
of the line too (something I do not want).

In the example, even though the data for
both lines begins at x=10 and ends at x=20, the
top line is longer.


Can I increase the width of a line without
increasing the length?

Thank you for your help;



::::::::::::: line_width_01.com :::::::::::::

set term pngcairo enhanced size 400, 200

set output 'line_width_01.png';
set nokey;
set origin 0.0, 0.0;

plot [ 0 :30 ][ 0: 50 ] \
     'line_width_01_01.dat' with lines lw 1, \
     'line_width_01_02.dat' with lines lw 7

::::::::::::: line_width_01_01.dat :::::::::::::

10      23
20      23


::::::::::::: line_width_01_02.dat :::::::::::::

10      27
20      27

[toc] | [next] | [standalone]


#1650

Fromsfeam <sfeam@users.sourceforge.net>
Date2013-02-18 10:23 -0800
Message-ID<kftrh2$3me$1@dont-email.me>
In reply to#1644
Ivan K. wrote:
> However, in the top line, I have set the line
> width to "7" but not only does this increase
> the width of the line (something I want)
> but increasing the width increases the _length_
> of the line too (something I do not want).

You are referring to the treatment of line segment ends
("end caps"). The options are conventionally called "butt", 
"square", and "round".  See here, for example:

    http://i.stack.imgur.com/xCRe3.png

Gnuplot's pngcairo terminal lets you choose between
"butt" or "round".  "square" is not currently supported.
It sounds like you want 
    set terminal pngcairo butt
 
> In the example, even though the data for
> both lines begins at x=10 and ends at x=20, the
> top line is longer.
> 
> 
> Can I increase the width of a line without
> increasing the length?
> 
> Thank you for your help;
> 
> 
> 
> ::::::::::::: line_width_01.com :::::::::::::
> 
> set term pngcairo enhanced size 400, 200
> 
> set output 'line_width_01.png';
> set nokey;
> set origin 0.0, 0.0;
> 
> plot [ 0 :30 ][ 0: 50 ] \
>      'line_width_01_01.dat' with lines lw 1, \
>      'line_width_01_02.dat' with lines lw 7
> 
> ::::::::::::: line_width_01_01.dat :::::::::::::
> 
> 10      23
> 20      23
> 
> 
> ::::::::::::: line_width_01_02.dat :::::::::::::
> 
> 10      27
> 20      27

[toc] | [prev] | [next] | [standalone]


#1651

From"Ivan K." <ivan_521521@yahoo.com>
Date2013-02-18 10:33 -0800
Message-ID<b644d97f-210f-4d8d-8a06-f8b817e7ae3c@d11g2000yqe.googlegroups.com>
In reply to#1650
Hello Mr. Sfeam.  Thank you for your response.

Just before you posted that, I found the page:

  http://gnuplot.10905.n7.nabble.com/bug-or-feature-td12930.html

which addresses this exact issue.  Based on
this page, like your suggestion, I changed:

  set term pngcairo enhanced      size 400, 200

to:

  set term png      enhanced butt size 400, 200

that is, I added "butt" to the "set term" command.
I also changed "pngcairo" to "png" as the option "butt"
did nothing to the resulting image with "pngcairo".


HOWEVER, this solution only "sort of " works
as there is now a  weird artifact at the beginning of
each line.  Obviously, I would like to get rid of
this artifact.

Thank you very much for your help;

:::::::::::::: line_width_02.com ::::::::::::::

set term png      enhanced butt size 400, 200

set output 'line_width_02.png';
set nokey;
set origin 0.0, 0.0;

plot [ 0 :30 ][ 0: 50 ] \
     'line_width_02_01.dat' w l lt 1 lw  1,  \
     'line_width_02_02.dat' w l lt 1 lw  7,  \
     'line_width_02_03.dat' w l lt 1 lw 11,  \
     'line_width_02_04.dat' w l lt 1 lw 15

:::::::::::::: line_width_02_01.dat ::::::::::::::
10      40
20      40

:::::::::::::: line_width_02_02.dat ::::::::::::::
10      30
20      30

:::::::::::::: line_width_02_03.dat ::::::::::::::
10      20
20      20

:::::::::::::: line_width_02_04.dat ::::::::::::::
10      10
20      10

[toc] | [prev] | [next] | [standalone]


#1652

From"Ivan K." <ivan_521521@yahoo.com>
Date2013-02-18 10:51 -0800
Message-ID<b79ccf1b-b4bd-4221-80e8-e523e1f0714d@r13g2000yqg.googlegroups.com>
In reply to#1651
The resultant image can be seen here:

http://www.flickr.com/photos/61572029@N04/8485683267/in/photostream/lightbox/

or here:

http://www.flickr.com/photos/61572029@N04/8485683267/in/photostream

Thanks;

[toc] | [prev] | [next] | [standalone]


#1653

Fromsfeam <sfeam@users.sourceforge.net>
Date2013-02-18 11:05 -0800
Message-ID<kfttvi$ikn$1@dont-email.me>
In reply to#1651
Ivan K. wrote:

> Just before you posted that, I found the page:
> 
>   http://gnuplot.10905.n7.nabble.com/bug-or-feature-td12930.html
> 
> which addresses this exact issue.  Based on
> this page, like your suggestion, I changed:
> 
>   set term pngcairo enhanced      size 400, 200
> 
> to:
> 
>   set term png      enhanced butt size 400, 200
> 
> that is, I added "butt" to the "set term" command.
> I also changed "pngcairo" to "png" as the option "butt"
> did nothing to the resulting image with "pngcairo".

Yes.  I had forgotten that the cairo terminal interprets
"butt" on the command line as "square" internally.
The Nabble page you link to explains this clearly.
Unfortunately the suggestion given there that additional line
options  could appear in gnuplot 4.6 was not implemented.
It should go back on a wishlist for gnuplot 5.

So I'm afraid that gnuplot does not provide the detailed
control over individual line properties that you want.
If you choose an output mode that can be further edited
(notably PostScript or SVG) then you could tweak the 
result in an external tool like Acrobat or Inkscape.
It is also possible that you could customize your locally
installed PostScript prologue files to set your preferred
line attributes by default in gnuplot.

	Ethan

> 
> 
> HOWEVER, this solution only "sort of " works
> as there is now a  weird artifact at the beginning of
> each line.  Obviously, I would like to get rid of
> this artifact.
> 
> Thank you very much for your help;
> 
> :::::::::::::: line_width_02.com ::::::::::::::
> 
> set term png      enhanced butt size 400, 200
> 
> set output 'line_width_02.png';
> set nokey;
> set origin 0.0, 0.0;
> 
> plot [ 0 :30 ][ 0: 50 ] \
>      'line_width_02_01.dat' w l lt 1 lw  1,  \
>      'line_width_02_02.dat' w l lt 1 lw  7,  \
>      'line_width_02_03.dat' w l lt 1 lw 11,  \
>      'line_width_02_04.dat' w l lt 1 lw 15
> 
> :::::::::::::: line_width_02_01.dat ::::::::::::::
> 10      40
> 20      40
> 
> :::::::::::::: line_width_02_02.dat ::::::::::::::
> 10      30
> 20      30
> 
> :::::::::::::: line_width_02_03.dat ::::::::::::::
> 10      20
> 20      20
> 
> :::::::::::::: line_width_02_04.dat ::::::::::::::
> 10      10
> 20      10

[toc] | [prev] | [next] | [standalone]


#1654

From"Ivan K." <ivan_521521@yahoo.com>
Date2013-02-18 11:12 -0800
Message-ID<1f67b2c2-3723-41e1-ad7c-2b87fb630c45@k8g2000yqb.googlegroups.com>
In reply to#1653
On Feb 18, 1:05 pm, sfeam <sf...@users.sourceforge.net> wrote:
>
> Unfortunately the suggestion given there that additional line
> options  could appear in gnuplot 4.6 was not implemented.
> It should go back on a wishlist for gnuplot 5.

How does one go about officially putting this on the list
for future implementation?


> So I'm afraid that gnuplot does not provide the detailed
> control over individual line properties that you want.

I am dismayed.


Thank you Ethan for your expert knowledge of
gnuplot and your willingness to share!

[toc] | [prev] | [next] | [standalone]


#1655

From"Ivan K." <ivan_521521@yahoo.com>
Date2013-02-18 11:17 -0800
Message-ID<ed09af88-0cc5-4270-8793-732c01e2c9d1@h17g2000yqe.googlegroups.com>
In reply to#1654
Hey, it works with "term svg":

   set term svg      enhanced butt size 400, 200

It still would be nice if it worked with "term png" though.

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web