Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

In short, this is due to a behaviour in Mathematica's graphics rendering that seems intentional, but it is very strange in this particular context: Scaled coordinates are scaled by GeometricTransform and by Scale. The arrowheads sizes are specified in scaled coordinates. Unfortunately there is no good way to specify them in absolute (offset) coordinates.Unfortunately there is no good way to specify them in absolute (offset) coordinates.

SciDraw adds a GeometricTransform, which then affects the arrowheads, and (unintentionally) upscales them to ridiculous sizes. They become so large that they fill up the viewport.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying problem

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In this particular context this makes no sense to me. But the general behaviour is clearly intentional. The documentation of Scale explicitly states it:

For objects specified with scaled coordinates Scaled[{x,y}], Scale effectively applies its transformation to the corresponding ordinary coordinates.

Thus this is perhaps not a "bug" (even though in situations like this one it is clearly undesirable).

In short, this is due to a behaviour in Mathematica's graphics rendering that seems intentional, but it is very strange in this particular context: Scaled coordinates are scaled by GeometricTransform and by Scale. The arrowheads sizes are specified in scaled coordinates. Unfortunately there is no good way to specify them in absolute (offset) coordinates.

SciDraw adds a GeometricTransform, which then affects the arrowheads, and (unintentionally) upscales them to ridiculous sizes. They become so large that they fill up the viewport.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying problem

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In this particular context this makes no sense to me. But the general behaviour is clearly intentional. The documentation of Scale explicitly states it:

For objects specified with scaled coordinates Scaled[{x,y}], Scale effectively applies its transformation to the corresponding ordinary coordinates.

Thus this is perhaps not a "bug" (even though in situations like this one it is clearly undesirable).

In short, this is due to a behaviour in Mathematica's graphics rendering that seems intentional, but it is very strange in this particular context: Scaled coordinates are scaled by GeometricTransform and by Scale. The arrowheads sizes are specified in scaled coordinates. Unfortunately there is no good way to specify them in absolute (offset) coordinates.

SciDraw adds a GeometricTransform, which then affects the arrowheads, and (unintentionally) upscales them to ridiculous sizes. They become so large that they fill up the viewport.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying problem

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In this particular context this makes no sense to me. But the general behaviour is clearly intentional. The documentation of Scale explicitly states it:

For objects specified with scaled coordinates Scaled[{x,y}], Scale effectively applies its transformation to the corresponding ordinary coordinates.

Thus this is perhaps not a "bug" (even though in situations like this one it is clearly undesirable).

added 1202 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

In short, this is due to a behaviour in Mathematica's graphics rendering that I would consider a bug. Arrowheadsseems intentional, but it is very strange in this particular context: Scaled coordinates are scaled by GeometricTransformGeometricTransform and by Scale. This makes no sense to me because the arrowhead specification is The arrowheads sizes are specified in scaled units, not in plot coordinates. Unfortunately there is no good way to specify them in absolute (offset) coordinates.

TheSciDraw adds a GeometricTransform is added by SciDraw, which then affects the arrowheads, and (unintentionally) upscales them to ridiculous sizes. They become so large that they fill up the viewport.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying "bug" (?)problem

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In my opinion this is incorrectparticular context this makes no sense to me. Scaled coordinates should not be affected by GeometricTransform But the general behaviour is clearly intentional. Yet they are, even when specified usingThe documentation of Scaled. ForScale explicitly states it:

For objects specified with scaled coordinates Scaled[{x,y}], Scale effectively applies its transformation to the corresponding ordinary coordinates.

Thus this reason I am reallyis perhaps not sure if the behavioura "bug" (even though in situations like this one it is intentionalclearly undesirable).

In short, this is due to a behaviour in Mathematica's graphics rendering that I would consider a bug. Arrowheads are scaled by GeometricTransform. This makes no sense to me because the arrowhead specification is in scaled units, not in plot coordinates.

The GeometricTransform is added by SciDraw.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying "bug" (?)

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In my opinion this is incorrect. Scaled coordinates should not be affected by GeometricTransform. Yet they are, even when specified using Scaled. For this reason I am really not sure if the behaviour is intentional.

In short, this is due to a behaviour in Mathematica's graphics rendering that seems intentional, but it is very strange in this particular context: Scaled coordinates are scaled by GeometricTransform and by Scale. The arrowheads sizes are specified in scaled coordinates. Unfortunately there is no good way to specify them in absolute (offset) coordinates.

SciDraw adds a GeometricTransform, which then affects the arrowheads, and (unintentionally) upscales them to ridiculous sizes. They become so large that they fill up the viewport.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying problem

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In this particular context this makes no sense to me. But the general behaviour is clearly intentional. The documentation of Scale explicitly states it:

For objects specified with scaled coordinates Scaled[{x,y}], Scale effectively applies its transformation to the corresponding ordinary coordinates.

Thus this is perhaps not a "bug" (even though in situations like this one it is clearly undesirable).

added 1202 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

In short, this is due to a behaviour in Mathematica's graphics rendering that I would consider a bug. Arrowheads are scaled by GeometricTransform. This makes no sense to me because the arrowhead specification is in scaled units, not in plot coordinates.

The GeometricTransform is added by SciDraw.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying "bug" (?)

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In my opinion this is incorrect. Scaled coordinates should not be affected by GeometricTransform. Yet they are, even when specified using Scaled. For this reason I am really not sure if the behaviour is intentional.

In short, this is due to a behaviour in Mathematica's graphics rendering that I would consider a bug. Arrowheads are scaled by GeometricTransform. This makes no sense to me because the arrowhead specification is in scaled units, not in plot coordinates.

The GeometricTransform is added by SciDraw.

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

In short, this is due to a behaviour in Mathematica's graphics rendering that I would consider a bug. Arrowheads are scaled by GeometricTransform. This makes no sense to me because the arrowhead specification is in scaled units, not in plot coordinates.

The GeometricTransform is added by SciDraw.

Workaround

To work around the problem, I suggest manually reducing the arrowhead sizes to compensate. You can do this with replacement rules.

Instead of

FigGraphics[plot]

use

FigGraphics[
 plot /. Arrowheads[{{s_, pos_}}] :> Arrowheads[{{0.006 s, pos}}]
]

The underlying "bug" (?)

The below graphics display the same way regardless the value of s. Also, all graphics elements scale proportionally when resizing the figure with the mouse. This is proof that the Arrowhead specification is in scaled coordinates.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], Arrow[{{0, 0}, s {1, 0}}]},
 PlotRange -> s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
]

Mathematica graphics

Now let us put in a GeometricTransform to scale everything to double size. To show the whole arrow, we manually double the plot range as well.

s = 5;
Graphics[
 {Arrowheads[{{0.5, 1}}], 
  GeometricTransformation[
   Arrow[{{0, 0}, s {1, 0}}], {2 {1, 0}, {0, 1}}]},
 PlotRange -> 2 s {{0, 1}, {-.25, .25}},
 AspectRatio -> Automatic,
 Frame -> True
 ]

Mathematica graphics

The scaling has affected the arrowhead. In my opinion this is incorrect. Scaled coordinates should not be affected by GeometricTransform. Yet they are, even when specified using Scaled. For this reason I am really not sure if the behaviour is intentional.

Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k
Loading