0
$\begingroup$

Considering that I have some coordinates, now I would like to draw it with a hollow rectangle or circle

Graphics[Point[Table[{t, Sin[t]}, {t, 0, 2 Pi, 2 Pi/10}]]]

enter image description here

Is there options like PointStyle -> "Hollow Cirle"/"Hollow Rectangle"/"Solid Rectangle" for Point primitive to let the user specify the corresponding point style?

$\endgroup$
  • $\begingroup$ Graphics@Table[Circle[{t, Sin[t]}, 0.1], {t, 0, 2 Pi, 2 Pi/10}] or Graphics@Table[ Rectangle[{t - 0.05, Sin[t] - 0.05}, {t + 0.05, Sin[t] + 0.05}], {t, 0, 2 Pi, 2 Pi/10}] or Graphics@{FaceForm[White], EdgeForm[Black], Table[Rectangle[{t - 0.05, Sin[t] - 0.05}, {t + 0.05, Sin[t] + 0.05}], {t, 0, 2 Pi, 2 Pi/10}]} $\endgroup$ – Feyre Oct 30 '16 at 9:42
3
$\begingroup$

I decided to expand on my comment:

It is possible to use any Graphics object as the "plot marker" for a function of data points rendered with graphics.

Graphics@Table[Circle[{t, Sin[t]}, 0.1], {t, 0, 2 Pi, 2 Pi/10}]

enter image description here

Where you can use EdgeForm[] and FaceForm[] to alter the appearance of objects.

Graphics3D[{EdgeForm[{Thick, Blue}], FaceForm[{Pink, Opacity[0.8]}], 
  Table[Cuboid[{Sin[t], Cos[t], t}], {t, 0, 4 Pi, Pi/4}]}, 
 Boxed -> False]

enter image description here

This is a particularly effective way of making interesting looking Graphics.

Graphics3D[
 Table[{FaceForm[{ColorData[35][10 t/(4 Pi)], Opacity[0.8]}], 
   Cuboid[{Sin[t], Cos[t], t/2}]}, {t, 0, 4 Pi, Pi/4}], 
 Boxed -> False]

enter image description here

$\endgroup$
  • $\begingroup$ @newer If you mean the wonky looking squares, try Graphics[Table[ Rectangle[{t - 0.2, Sin[t] - 0.2}, {t + 0.2, Sin[t] + 0.2}], {t, 0, 2 Pi, 2 Pi/10}]] it's a pixel density issue. $\endgroup$ – Feyre Oct 30 '16 at 10:05
  • $\begingroup$ Your workaround is fine, nice job. However, if the units of the axes are very different, then your circles or rectangles will be distorted. You can scale them, of course. A workaround is to place text "o"s with Text["o",{t,Sin[t]}]. Not that I like it. For publishable output you will just need to get the scaling right for the Circles or Rectangles. $\endgroup$ – Nicholas G Oct 30 '16 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.