Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Line width in plot2d?

2,558 views
Skip to first unread message

David Nicholls

unread,
Mar 31, 2004, 5:20:07 AM3/31/04
to
I think the answer to this is "no", but I'll ask anyway.

Is there a way to change the line width for a curve plotted in plot2d?
I want a continuous line, but the default line is a bit thin.

The 'style' setting appears to be the way to go, but I can't find a list
of the options. Negative style values eg [-4,-5,-6] appear to plot in
symbols (black), whereas positive numbers eg [7,2] plot solid thin
coloured lines.

DN

Enrico Segre

unread,
Mar 31, 2004, 5:48:18 AM3/31/04
to
On Wed, 31 Mar 2004 20:20:07 +1000, David Nicholls wrote:

> Is there a way to change the line width for a curve plotted in plot2d?
> I want a continuous line, but the default line is a bit thin.

xset("thickness",3);plot2d()

David Nicholls

unread,
Mar 31, 2004, 7:01:52 AM3/31/04
to
Brilliant! What an excellent program!

DN

Moti Litockevski

unread,
Apr 1, 2004, 3:01:36 AM4/1/04
to
David Nicholls <nicholls@u030dotaonedotnetdotau> wrote in message news:<406ab333$0$16585$5a62...@freenews.iinet.net.au>...

I want to use this thread to bring up something I've been trying to do
for some time and finally and gave up.

Is there a way to change the thickness of the graph line but not the
frame or grid?

Moti

Enrico Segre

unread,
Apr 1, 2004, 3:39:34 AM4/1/04
to
Addendum:

On Thu, 01 Apr 2004 10:36:36 +0200, Enrico Segre wrote:

> I know no other way than plotting twice-- the thick line without the
> frame, and the frame on the same scale (strf="x0z") - e.g.

this clearly in the "old" plotting style. I wonder, what about the new OO
mode? perhaps changing some "thickness" attribute of the "line" object
child of the parent graph?

e.

Enrico Segre

unread,
Apr 1, 2004, 3:36:36 AM4/1/04
to
On Thu, 01 Apr 2004 00:01:36 -0800, Moti Litockevski wrote:

> Is there a way to change the thickness of the graph line but not the
> frame or grid?

I know no other way than plotting twice-- the thick line without the


frame, and the frame on the same scale (strf="x0z") - e.g.

x=1:20; y=rand(x);
xbasc();
xset("thickness",1);
plot2d(x,y,strf="021"); xgrid(3)
xset("thickness",3)
plot2d(x,y,strf="000");

if x,y are big, you could speed up things by calling plotframe() and
xaxis() instead, to avoid the replot of the data.

hth, Enrico

Bruno

unread,
Apr 1, 2004, 8:18:46 AM4/1/04
to
> Is there a way to change the thickness of the graph line but not the
> frame or grid?

It is possible (but long to write). The method is to
plot the datas without the frame of the plot (axesflag=0)
then return to the usual thickness and plot only the
frame and the grid if needed... Here is an example :

x = linspace(0,2*%pi,60);
y = cos(x);
xset("thickness", 3)
xbasc()
plot2d(x, y, style=2, axesflag=0) // plot the datas
xset("thickness", 1)
plot2d(-%inf, -%inf, frameflag=0) // plot the frame without change
xgrid() // the scale (frameflag=0)

hth
Bruno

Stéphane Mottelet

unread,
Apr 1, 2004, 1:41:04 PM4/1/04
to
Le 1 Apr 2004 00:01:36 -0800, Moti Litockevski <mo...@wavion.biz> a écrit:

> David Nicholls <nicholls@u030dotaonedotnetdotau> wrote in message
> news:<406ab333$0$16585$5a62...@freenews.iinet.net.au>...
>> Brilliant! What an excellent program!
>>
>> DN
>>
>> Enrico Segre wrote:
>>
>> > On Wed, 31 Mar 2004 20:20:07 +1000, David Nicholls wrote:
>> >
>> >> Is there a way to change the line width for a curve plotted in
>> plot2d?
>> >> I want a continuous line, but the default line is a bit thin.
>> >

This is easy with plotlib (http://www.dma.utc.fr/~mottelet/plotlib.html)

plot(x,y,'2') : equivalent to xset('thickness',2) for the curve,
but the axis and grid remain as usual.

S.

--
Utilisant M2, le client e-mail révolutionnaire d'Opera :
http://www.opera.com/

David Nicholls

unread,
Apr 1, 2004, 7:36:18 PM4/1/04
to
Stéphane Mottelet wrote:

>>> >> Is there a way to change the line width for a curve plotted in
>>> plot2d?
>>> >> I want a continuous line, but the default line is a bit thin.

> plot(x,y,'2') : equivalent to xset('thickness',2) for the curve,


> but the axis and grid remain as usual.
>
> S.

Plotlib looks really useful, but I have not found a way to change the
fonts for the title etc. Plotlib does not appear to respond when you
use xlfont and xset to change one of the default fonts. Plotlib still
uses the default values. Is there a way to change this?

DN

Stéphane Mottelet

unread,
Apr 4, 2004, 8:29:42 AM4/4/04
to

> Plotlib looks really useful, but I have not found a way to change the
> fonts for the title etc. Plotlib does not appear to respond when you
> use xlfont and xset to change one of the default fonts. Plotlib still
> uses the default values. Is there a way to change this?
>
> DN
>

I think I will add such a functionality in the next release, if the new
graphic system (which will became the default mode) of version 3.0
doesn't give me too much porting work (I am not optimistic about this).

0 new messages