Make Axis and ticks invisible in mathematica plot, but keep labels -


i want make mathematica plot no visible y-axis, retaining tick labels.

i've tried axesstyle -> {thickness[.001], thickness[0]} no effect, , setting opacity 0 makes tick labels transparent (and invisible).

any appreciated...

p = plot[sin[x], {x, 0, 6 pi},  axesstyle -> {black, opacity[0]},  ticksstyle -> directive[opacity[1], black]]  ticks = absoluteoptions[p, ticks];  ticks[[1, 2, 2]] = deletecases[ticks[[1, 2, 2]], {_, "", __}];  ticks[[1, 2, 2, all, 3]] = constantarray[{0, 0},    length[ticks[[1, 2, 2, all, 3]]]];  ticks[[1, 2, 2, all, 2]] = map[tostring,     ticks[[1, 2, 2, all, 2]]] /. a_string :>     if[stringtake[a, -1] == ".", <> "0", a];  plot[sin[x], {x, 0, 6 pi},  axesstyle -> {black, directive[opacity[0], red]},  ticksstyle -> directive[opacity[1], black],  ticks -> {automatic, ticks[[1, 2, 2]]}] 

enter image description here

to exact original ticks can use

cases[charting`findticks[{0, 1}, {0, 1}] @@ plotrange[p][[2]], {_, _}] 

{{-1.,-1.0},{-0.5,-0.5},{0.,0},{0.5,0.5},{1.,1.0}}

as implemented here:

p = plot[sin[x], {x, 0, 6 pi},    axesstyle -> {automatic, opacity[0]},    ticksstyle -> opacity[1]]; ticks = absoluteoptions[p, ticks]; onestyledtick = ticks[[1, 2, 2, 1]]; labels = cases[charting`findticks[{0, 1}, {0, 1}] @@     plotrange[p][[2]], {_, _}]; yticks = map[join[#, {{0, 0}},      take[onestyledtick, -1]] &, labels]; plot[sin[x], {x, 0, 6 pi},  axesstyle -> {automatic, opacity[0]},  ticksstyle -> opacity[1],  ticks -> {automatic, yticks}] 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -