Message Boards Message Boards

Quantify directive Large in graphics?

Posted 5 years ago

Hi,

During my work with mathematics, I came across a problem with how to quantify directive Large etc. I need to quantify the directive to export my graphics to an external vector format. I copied an example from the help command Graphics.

Graphics[{Thick, Green, Rectangle[{0, -1}, {2, 1}], Red, Disk[], Blue,
Circle[{2, 0}], Yellow, Polygon[{{2, 0}, {4, 1}, {4, -1}}], Purple,
Arrowheads[Large], Arrow[{{4, 3/2}, {0, 3/2}, {0, 0}}], Black, 
Dashed, Line[{{-1, 0}, {4, 0}}]}]

I tried FullForm to look inside, but no result.

Graphics[List[Thickness[Large],RGBColor[0,1,0],Rectangle[List[0,-1],List[2,1]],RGBColor[1,0,0],Disk[List[0,0]],RGBColor[0,0,1],Circle[List[2,0]],RGBColor[1,1,0],Polygon[List[List[2,0],List[4,1],List[4,-1]]],RGBColor[0.5`,0,0.5`],Arrowheads[Large],Arrow[List[List[4,Rational[3,2]],List[0,Rational[3,2]],List[0,0]]],GrayLevel[0],Dashing[List[Small,Small]],Line[List[List[-1,0],List[4,0]]]]]

I guess the problem is related to evaluating graphics by FrontEnd, but I don't know how to convince Mathematica to return an evaluated expression with substution by numbers.

Do you how to get result?

POSTED BY: Mirek M
2 Replies

Maybe this is what you want:

gr = Graphics[(* your graphics *)];
AbsoluteOptions[gr]

EDIT:

Probably better is to avoid directives like Large at all, e.g.:

Graphics[{AbsoluteThickness[3], Green, Rectangle[{0, -1}, {2, 1}], 
  Red, Disk[], Blue, Circle[{2, 0}], Yellow, 
  Polygon[{{2, 0}, {4, 1}, {4, -1}}], Purple, Arrowheads[.1], 
  Arrow[{{4, 3/2}, {0, 3/2}, {0, 0}}], Black, 
  AbsoluteDashing[{10, 20}], Line[{{-1, 0}, {4, 0}}]}]

Does that help?

POSTED BY: Henrik Schachner
Posted 5 years ago

Thank you for your advice.

AbsoluteOptions[gr]

in this case doesn't work because Thickness[Large] is not Options. AbsoluteOptions get numerical value for Axes, Frame, Ticks ... but not for graphics primitives.

I agree with you that better is not to use directives like Large, Tiny, ...

POSTED BY: Mirek M
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract