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

Plotting discontinuous lines

0 views
Skip to first unread message

Virgil Stokes

unread,
Jun 19, 1999, 3:00:00 AM6/19/99
to
I have a list of two sets of from,to coordinate pairs that define
line segments. For example I would like to produce a plot of
the form:


------- ----- -- -- ----


-- - ----- ----- -----

where the top set of line might contain the following set of (x,y) pairs for the

endpoints of each line segment at y = 2:

{{1,2},{7,2),{10,2,},{14,2},{16,2},{17,2},{23,2},{24,2},{30,2},{33,2}}

where, {1,2},{7,2} are the x,y coordinates of the endpoints of the first line
at the top.

While the bottom set of line segments are defined by:

{{8,-2},{9,-2},{15,-2},{15,-2},{18,-2},{22,-2},{25,-2},{29,-2},{34,-2},{38,-2}}

and, {8,-2},{9,-2} are the x,y coordinates of the endpoints of the first line at
the bottom

The problem is how to draw, efficiently the two sets of discontinuous line
segments.
In general, the number of discontinuous line segments will vary from one data
set
to another.

Perhaps this is a trivial problem; but, I have not been able to find a
way to perform these type of plots in an automatic way when
the size of these from, to lists are unknown in advance. Any suggestions
would be appreciated.

-- Virgil


Jens-Peer Kuska

unread,
Jun 21, 1999, 3:00:00 AM6/21/99
to
Hi Virgil,

don't say that it is so easy:


data={{1,2},{7,2},{10,2},{14,2},{16,2},{17,2},{23,2},{24,2},{30,2},{33,2}};
data1={{8,-2},{9,-2},{15,-2},{15,-2},{18,-2},{22,-2},{25,-2},{29,-2},{34,-2},{
38,-2}};


Show[Graphics[ (Line /@ Partition[#,2]) & /@ {data,data1}]]


Regards
Jens

Virgil Stokes wrote:
>
> I have a list of two sets of from,to coordinate pairs that define
> line segments. For example I would like to produce a plot of
> the form:
>
> ------- ----- -- -- ----
>
> -- - ----- ----- -----
>

SNIP SNAPP


> The problem is how to draw, efficiently the two sets of discontinuous line
> segments.
> In general, the number of discontinuous line segments will vary from one data
> set
> to another.

SNIPP SNAPP
> -- Virgil


0 new messages