You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by dao <da...@gmail.com> on 2009/12/22 14:06:12 UTC

draw a set of points

hello,

Is it possible to draw a point with SVG? polylines, paths, etc... seems not
appropriate to do that. Do I need to draw a rect or circle with a size of 0
(or 1)?

I want to draw a chart representing a set of points not linked together

regards,

-- 
Dao Hodac

Re: draw a set of points

Posted by th...@kodak.com.
Hi all,

      Just to offer my 2cents on this.  I think the most efficient way to 
draw this would
be a polyline with markers (and fill="none" and stroke="none").  This is 
also convenient 
as you can setup the markers to scale with 'stroke-width' (even though the 
stroke isn't drawn),
so that the 'points' can stay small as you zoom in.  Jonathan is right 
that you need to use 
either a rect or circle suitably sized so it appears to be a 'point'.

> jonathan wood a écrit :
> >
> > Use a circle or rect with a size that fits the coord system that you 
> > need to use.  Because of scalability, the "width" of a point is fairly 

> > meaningless.
> > On Tue, Dec 22, 2009 at 8:06 AM, dao <dao.hodac@gmail.com 
> > <ma...@gmail.com>> wrote:
> >
> >     hello, 
> >     Is it possible to draw a point with SVG? polylines, paths, etc...
> >     seems not appropriate to do that. Do I need to draw a rect or
> >     circle with a size of 0 (or 1)?
> >     I want to draw a chart representing a set of points not linked
> >     together

Thomas DeWeese | CDG Advanced Development | 
Eastman Kodak Company | 343 State Street | Rochester, NY 14650-0128 | 
Thomas.DeWeese@Kodak.com | 585 724-0294 | 
www.kodak.com 

Re: draw a set of points

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,
I can see 2 cases:
 - dots along a line or a curve:
   you can simply use CSS styles, for example: rounded dots:
   fill: none; stroke: #000; stroke-width: 1.5; stroke-linecap: round; 
stroke-dasharray: 0,3;

 - area filled with dots:
   you can use a pattern:
<defs>
  <pattern id="myDotPattern" width="5" height="5" 
patternUnits="userSpaceOnUse">
    <circle fill="black" cx="1" cy="1" r="0.75"/>
  </pattern>
</defs>
<rect style="fill:url(#myDotPattern)" width="100" height="50"/>

HTH,
Pascal

jonathan wood a écrit :
>
> Use a circle or rect with a size that fits the coord system that you 
> need to use.  Because of scalability, the "width" of a point is fairly 
> meaningless.
> On Tue, Dec 22, 2009 at 8:06 AM, dao <dao.hodac@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     hello, 
>     Is it possible to draw a point with SVG? polylines, paths, etc...
>     seems not appropriate to do that. Do I need to draw a rect or
>     circle with a size of 0 (or 1)?
>     I want to draw a chart representing a set of points not linked
>     together
>     regards,
>     -- 
>     Dao Hodac
>


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: draw a set of points

Posted by jonathan wood <jo...@gmail.com>.
Use a circle or rect with a size that fits the coord system that you need to
use.  Because of scalability, the "width" of a point is fairly meaningless.

On Tue, Dec 22, 2009 at 8:06 AM, dao <da...@gmail.com> wrote:

> hello,
>
> Is it possible to draw a point with SVG? polylines, paths, etc... seems not
> appropriate to do that. Do I need to draw a rect or circle with a size of 0
> (or 1)?
>
> I want to draw a chart representing a set of points not linked together
>
> regards,
>
> --
> Dao Hodac
>

Re: draw a set of points

Posted by "G. Wade Johnson" <gw...@anomaly.org>.
On Tue, 22 Dec 2009 14:06:12 +0100
dao <da...@gmail.com> wrote:

> hello,
> 
> Is it possible to draw a point with SVG? polylines, paths, etc...
> seems not appropriate to do that. Do I need to draw a rect or circle
> with a size of 0 (or 1)?
> 
> I want to draw a chart representing a set of points not linked
> together

This took me a while to completely resolve in my mind. A "point" would
have no size, so would not be drawn. What most people are thinking of
when they say they want to draw a point, is that they want a pixel.
But, vector graphics doesn't really have a concept of pixels.

Drawing a rect or circle at a small size would probably give you the
effect you want. But, zooming in would cause it to grow.

This and the position of lines, are probably the concepts that are the
hardest to remember when changing from raster graphics to vector
graphics.

G. Wade
-- 
The function of good software is to make the complex appear to be
simple. -- Grady Booch

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org