# How can I make the size of the Ticks consistent with the size of the figure?

I wrote this code to help me manipulate the size of the figure along x and y (controlled byXZ,YZ) with possessing consistent Ticks but I left with one step which is to get rid of the green numbers without using White color. How can I do that?

TX[XZ_, YZ_] := Piecewise[{{XZ/YZ, XZ >= YZ}, {1, XZ < YZ}}]
s[j_, tl_] := Table[{j i, j i, {0, -tl}, Black}, {i, -10^2, 10^2}];
p[j_, ts_, ns_] :=
Table[{(j (i))/ns, "", {0, -ts}, Black}, {i, -10^2, 10^2}];(*ns>1*)
ticks[j_, tl_, ts_, ns_] := ArrayFlatten[{{s[j, tl]}, {p[j, ts, ns]}}];
Tx[MSx_, Msz_, Ssz_, nSS_, XZ_, YZ_] :=
ticks[MSx, Msz TX[XZ, YZ] , Ssz TX[XZ, YZ] , nSS];
SystemPlotThemeDumpresolvePlotTheme[{"mysty", x_Real, y_Real, YZ_,
XZ_}, _] :=
{AspectRatio -> 1,
LabelStyle -> {FontSize -> 18, Black,
FontFamily -> "Times New Roman"},
FrameStyle -> Directive[{Black, Thickness[TX[YZ, XZ] x]}],
Frame -> True,
FrameTicksStyle -> {{Directive[Black, Thickness[TX[YZ, XZ] y]],
Green},
{Directive[Black, Thickness[TX[YZ, XZ] y]], Green}}}

With[{XZ = 400, YZ = 200, sx = 3, sy = 1},
Plot[Sin[z], {z, -2 Pi, 2 Pi}, FrameLabel -> {"X", "Y"},
Axes -> False, PlotStyle -> Directive[Red],
ImageSize -> Automatic -> {XZ, YZ},
FrameTicks -> {Tx[sx, 0.03, 0.015, 2 sx, XZ, YZ],
Tx[sy, 0.03, 0.015, 5 sy, YZ, XZ]},
PlotTheme -> {"mysty", 0.003 , 0.003, YZ, XZ}, ImagePadding -> 80]]


• Replace Green with FontColor->White?
– kglr
Commented Jul 13, 2020 at 20:56
• @kglr, what is the difference if we replace Green with White? Commented Jul 13, 2020 at 22:30
• HD2006, no difference in this case (because tick colors are set via ticks and the color directive in FrameTicksStyle affects only the label color). In general, frame/ticks/labels can be styled independently of each other as in, e.g.,Plot[x, {x, 0, 1}, Frame -> True, BaseStyle -> 20, FrameStyle -> {{Purple, Brown}, {Yellow, Magenta}}, FrameTicks -> All, FrameTicksStyle -> {{Automatic, Blue}, {Red, Directive[Green, FontColor -> Orange]}}]
– kglr
Commented Jul 14, 2020 at 5:00

Use the form FrameTicks -> {{leftticks, Automatic}, {bottomticks, Automatic}} to specify frame ticks:

With[{XZ = 400, YZ = 200, sx = 3, sy = 1},
Plot[Sin[z], {z, -2 Pi, 2 Pi}, FrameLabel -> {"X", "Y"},
Axes -> False, PlotStyle -> Directive[Red],
ImageSize -> Automatic -> {XZ, YZ},
FrameTicks -> {{Tx[sy, 0.03, 0.015, 5 sy, YZ, XZ], Automatic},
{Tx[sx, 0.03, 0.015, 2 sx, XZ, YZ], Automatic}},
PlotTheme -> {"mysty", 0.003, 0.003, YZ, XZ}, ImagePadding -> 80]]


• I really did that but I started with x-axis Ticks like this: FrameTicks -> {{Tx[sx, 0.03, 0.015, 5 sx, XZ, YZ],Automatic}, {Tx[sy, 0.03, 0.015, 2 sy, YZ, XZ], Automatic}} but the style was destroyed. i just realize that Mathematica starts with y-axis :-) Commented Jul 14, 2020 at 10:24
• why is it not working with ListLinePlot ? data = Table[{z, Sin[z]}, {z, -2 Pi, 2 Pi, 0.1}]; With[{XZ = 400, YZ = 200, sx = 3, sy = 1}, ListLinePlot[data, FrameLabel -> {"X", "Y"}, Axes -> False, PlotStyle -> Directive[Red], ImageSize -> Automatic -> {XZ, YZ}, FrameTicks -> {{Tx[sy, 0.03, 0.015, 5 sy, YZ, XZ], Automatic}, {Tx[sx, 0.03, 0.015, 2 sx, XZ, YZ], Automatic}}, PlotTheme -> {"mysty", 0.003, 0.003, YZ, XZ}, ImagePadding -> 80]] Commented Aug 8, 2020 at 17:47