6
$\begingroup$

This is probably quite a simple question, but I am looking to plot these circles and mark their centres with + and x markers, not the standard dot-like marker. Any help would be great! Thanks!

outercircle = Graphics[{{Black, Thick, Circle[{0, 2}, 2]}}];
innercircle = Graphics[{{Black, Dashed, Thick, Circle[{0, 1}, 1]}}];
Centre1 = Graphics[{PointSize[Large], Black, Point[{0, 2}]}];
Centre2 = Graphics[{PointSize[Medium], Black, Point[{0, 1}]}];
Show[outercircle, innercircle, Centre1, Centre2]
$\endgroup$
1
  • $\begingroup$ Do you want a line figure, a polygon one, or a font glyph for each marker? Each is treated differently when aligning, scaling, exporting, and so forth. Fonts have been the least satisfactory to me, though MaTeX generally works well; however, others might have different values. $\endgroup$
    – Goofy
    Feb 22 at 14:41

2 Answers 2

6
$\begingroup$
ocircle = Circle[{0, 2}, 2];
icircle = Circle[{0, 1}, 1];
Graphics[{
  {Black, Thick, ocircle}
  , {Text[Style["x", 20, Bold, Red]
    , RegionCentroid@ocircle]}
  , {Black, Dashed, icircle}
  , {Text[Style["+", 15, Bold, Blue]
    , RegionCentroid@icircle]}
  }
 ]

enter image description here

$\endgroup$
4
  • $\begingroup$ I like your answer more than mine,. I did not know about RegionCentroid. This is better than what I did by manually shifting the center. $\endgroup$
    – Nasser
    Feb 22 at 12:30
  • $\begingroup$ Thanks. Wait a while longer and there will be other answers to choose from. $\endgroup$
    – Syed
    Feb 22 at 12:35
  • $\begingroup$ If you want a more symmetric "x" marker, instead of one that looks like a letter of the alphabet, consider using \[Cross] instead of x. $\endgroup$ Feb 23 at 16:28
  • $\begingroup$ Or draw lines explicitly as Graphics primitives. $\endgroup$
    – Syed
    Feb 23 at 16:30
5
$\begingroup$
ocircle = Circle[{0, 2}, 2];

icircle = Circle[{0, 1}, 1];

To center the text objects at desired positions, you can use BoundaryDiscretizeGraphics to transform font glyphs to graphics objects and use them as Inset

{tx, tplus} = BoundaryDiscretizeGraphics[Text[Style[#, 12, Bold]], _Text, 
     BaseStyle -> Directive[EdgeForm[], #2], 
     ImageSize -> 15] & @@@ {{"x", Red}, {"+", Blue}};


Graphics[{
  {Black, Thick, ocircle,
   Opacity[.5], Gray, AbsolutePointSize @ 25, Point @ RegionCentroid @ ocircle},
  {Black, Dashed, icircle, 
   Opacity[.5], Gray, AbsolutePointSize @ 25, Point @ RegionCentroid @ icircle}, 
  Inset[tx, RegionCentroid @ ocircle], 
  Inset[tplus, RegionCentroid @ icircle]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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