2
$\begingroup$

I am trying to imitate default frame of ContourPlot with AxisObject. I used AbsoluteOptions of ContourPlot (opt) together with AxisStyle (st) but AxisObject still looks blurry compared to the default frame which is sharp and crystal clear.

Any suggestion what style or option is missing in my imitation?

st = AxisStyle -> Directive[Opacity[1], Black, AbsoluteThickness[0.5]]; ContourPlot[x == y, {x, -2, 2}, {y, -2, 2}, ContourStyle -> None] opt = DeleteCases[AbsoluteOptions[%], FrameTicks -> _] /. (Frame -> True) -> (Frame -> False); Graphics[{AxisObject[ Line[N@{{-(25/12), -(25/12)}, {25/12, -(25/12)}}], N@{-(25/12), 25/12}, st], AxisObject[Line[N@{{-(25/12), 25/12}, {25/12, 25/12}}], N@{-(25/12), 25/12}, TickDirection -> "Inward", TickLabels -> None, st], AxisObject[Line[N@{{-(25/12), -(25/12)}, {-(25/12), 25/12}}], N@{-(25/12), 25/12}, st], AxisObject[Line[N@{{25/12, -(25/12)}, {25/12, 25/12}}], N@{-(25/12), 25/12}, TickDirection -> "Inward", TickLabels -> None, st]}, opt] 

enter image description here

Or a simpler example:

AxisObject is blurry compared to the default frame or default axis.

Graphics[{AxisObject[Line[{{-2, -1}, {2, -1}}], {-2, 2}]}, Frame -> True] Graphics[{AxisObject[Line[{{-2, 1}, {2, 1}}], {-2, 2}]}, Axes -> {True, False}] 

enter image description here

$\endgroup$
2
  • $\begingroup$ Try to use st = AxisStyle -> Directive[Opacity[1], Black, AbsoluteThickness[0.5], Antialiasing -> False]; or add Antialiasing -> False to your AxisStyle $\endgroup$ Commented 7 hours ago
  • $\begingroup$ @138Aspen It seems to improve it a bit but still not the same as default frame/axis. $\endgroup$ Commented 2 hours ago

1 Answer 1

2
$\begingroup$

I believe this is due to Antialiasing, which you can manually turn off.

Graphics[{AxisObject[Line[{{-2, 1}, {2, 1}}], {-2, 2}, DefaultBaseStyle -> {Antialiasing -> False}]}, Axes -> {True, False}] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.