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

Linetypes

52 views
Skip to first unread message

Paul Skoczylas

unread,
Jun 5, 1997, 3:00:00 AM6/5/97
to

Using Matlab v4, is it possible to edit how the dashed, dotted, and
dash-dot lines appear; specifically the length and/or spacing of the
dashes and dots?

Any help is greatly appreciated!

-Paul

rich pawlowicz

unread,
Jun 5, 1997, 3:00:00 AM6/5/97
to

Paul Skoczylas wrote:
>
> Using Matlab v4, is it possible to edit how the dashed, dotted, and
> dash-dot lines appear; specifically the length and/or spacing of the
> dashes and dots?


Ugly aren't they? I wish, I wish I wish TWM had tried to fix this.
I sent them long complaints back in the 4.1 days about how easy
it would be to add a "dash length" property, and how much it
would be appreciated, and how stunningly ugly their dashed and
dotted lines are (because of the wide gaps)....

...with zero effect. AS long as the pretty colours are available,
I guess they don't see a need for dashed lines.

Anyway, to change this you have to edit the postscript. That's the
bad news, the good news is that it is amazingly simple. Find the
lines:

% line types: solid, dotted, dashed, dotdash
/SO { [] 0 setdash } bdef
/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
/DA { [6 dpi2point mul] 0 setdash } bdef
/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4 dpi2point mul] 0 setdash } bdef

For nicer dashed lines, change the '6' in the '/DA' line to 2. You
can make nicer dotted lines by changing the '4' in the '/DO' line to 2,
and I'll let you experiment with DD lines...

Rich.


--
Remove XXX from email address.

Damian Packer

unread,
Jun 6, 1997, 3:00:00 AM6/6/97
to

Paul Skoczylas (P.Sko...@cfer.ualberta.ca) wrote:
> Using Matlab v4, is it possible to edit how the dashed, dotted, and
> dash-dot lines appear; specifically the length and/or spacing of the
> dashes and dots?

MATLAB doesn't support this yet, but it is on our wish list of future
enhancements.

-Damian

--
__ ______ Damian T. Packer
/ /|/ /\ The MathWorks, Inc.
/_/ /_____/ /| http://www.mathworks.com
| || ___ \/ | dam...@mathworks.com
| || | / \ |/
| || |/__/ | /\ |\/| | /\ |\ |
| ||______/ /--\ | | | /--\ | \|
| | | _ _ _
| | / /\ / ` |/ |_ |_|
|_|/ /--\ \_, |\ |_ |\

Perry W. Stout

unread,
Jun 8, 1997, 3:00:00 AM6/8/97
to

> Paul Skoczylas wrote:
> >
> > Using Matlab v4, is it possible to edit how the dashed, dotted, and
> > dash-dot lines appear; specifically the length and/or spacing of the
> > dashes and dots?
>
rich pawlowicz wrote:

> Ugly aren't they? I wish, I wish I wish TWM had tried to fix this.
> I sent them long complaints back in the 4.1 days about how easy
> it would be to add a "dash length" property, and how much it
> would be appreciated, and how stunningly ugly their dashed and
> dotted lines are (because of the wide gaps)....
>
> ...with zero effect.

The weird thing is, Matlab 3.5 had nice looking line
spacing, and Mathworks changed it to the poor look of
versions 4 and 5!

I also complained about the spacing when I first encountered
version 4 about a year and a half ago, and was also told
controlled line spacing (one might call it line "pitch") was
on the wish list.

Thanks so much for the postscript code fixes; perhaps I can
figure out how to automate the fix, using the Styled Text
Toolbox's "stfixps2" m-file.

Perry Stout
pws...@pacbell.net

Damian Packer

unread,
Jun 9, 1997, 3:00:00 AM6/9/97
to

rich pawlowicz (ric...@ocgy.ubc.ca) wrote:
> Paul Skoczylas wrote:
> >
> > Using Matlab v4, is it possible to edit how the dashed, dotted, and
> > dash-dot lines appear; specifically the length and/or spacing of the
> > dashes and dots?
>
>
> Ugly aren't they? I wish, I wish I wish TWM had tried to fix this.
> I sent them long complaints back in the 4.1 days about how easy
> it would be to add a "dash length" property, and how much it
> would be appreciated, and how stunningly ugly their dashed and
> dotted lines are (because of the wide gaps)....
>
> ...with zero effect. AS long as the pretty colours are available,
> I guess they don't see a need for dashed lines.

As someone else in this thread has pointed out, we have it on our wish
list to provide user-control over linestyles. We are looking for a
way to add a property that gives users complete control over
linestyles, including (but not limited to) dash length.

As always, your comments help us direct our efforts and set
priorities, and we appreciate them.

W.M. Drennan

unread,
Jun 9, 1997, 3:00:00 AM6/9/97
to

It is possible to change the length of the dashes, and
even the sequence of dot-dashes. For instance you could define
a new line type such as long-dash short-dash or long long short
etc. However this has to be done within the postscript file.
If you search through the .ps file, you'll see the comment line

% line types: solid, dotted, dashed, dotdash

Below this are the definitions of the four lines -- they differ
from version to version. Try playing with them, and it won't
take too long to figure out how they work. THen you can either
modify an existing definition or define new one. Your printer may
impose a limit as to how many new ones you can define.

Once new ones are defined, change the line type at the beginning
of each line in the ps file. Hint lines are typically added to
the file in the order they are plotted in matlab. Also, the axes
lines and tick marks are plotted first in the file (after the
definitions are set).

Finally, to get wht you want, you may have to iterate using ghostscript.
Good luck.

Will Drennan
CCIW, Burlington, Ontario, Canada

0 new messages