Skip to content

Commit

Permalink
xticks above axis
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobunse committed Dec 4, 2020
1 parent ef4c616 commit 7ced89e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/CriticalDifferenceDiagrams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ _axis_style(k::Int, changepoint::Int, reverse_x::Bool) =
"axis y line=none",
"xmin=1",
"xmax=$(k)",
"ymin=-$(changepoint+1)",
"ymin=-$(changepoint+1.5)",
"ymax=0",
"scale only axis",
"height=$(changepoint+2)\\baselineskip",
"width=\\axisdefaultwidth",
"ticklabel style={anchor=south, yshift=3pt, font=\\small}",
"every tick/.style={thin}",
"ticklabel style={anchor=south, yshift=1.33*\\pgfkeysvalueof{/pgfplots/major tick length}, font=\\small}",
"every tick/.style={yshift=.5*\\pgfkeysvalueof{/pgfplots/major tick length}}",
"axis line style={-}",
"title style={yshift=\\baselineskip}"
], ", ") *
(k <= 5 ? ", xtick={$(join(1:k, ","))}" : "") *
(reverse_x ? "" : ", x dir=reverse")
_treatment_command(label::String, rank::Float64, xpos::Float64, ypos::Float64, reverse_x::Bool) =
Plots.Command(join([
"\\draw (axis cs:$rank, 0) |- (axis cs:$xpos, -$ypos) node[",
"font=\\small, fill=white, inner sep=5pt, outer sep=-5pt, anchor=$(_label_anchor(xpos, reverse_x))",
"\\draw[semithick, rounded corners=1pt] (axis cs:$rank, 0) |- (axis cs:$xpos, -$ypos) node[",
"font=\\small, fill=white, inner xsep=5pt, outer xsep=-5pt, anchor=$(_label_anchor(xpos, reverse_x))",
"] {$label}"
]))
_label_anchor(xpos::Float64, reverse_x::Bool) = ["west", "east"][1 + (Int(xpos==1) + Int(reverse_x)) % 2]
Expand Down

0 comments on commit 7ced89e

Please sign in to comment.