# Plot with tick labels but without ticks

In scientific literature, plots often have a design like what I've been trying to make (see below).
These images have the following characteristics:
1) Frames on the left and on the right
2) An x-axis with (automatic) ticks but without labels.
3) Tick labels on the bottom but without the ticks themselves

Plot[Sin[x], {x, 0, 10},
Frame -> {{True, True}, {True, False}},
FrameTicks -> {{All, All}, {All, None}},
FrameStyle -> {{None, None}, {White, None}},
FrameTicksStyle -> {{None, None},
{Directive[FontColor -> Gray, White], None}},


The way I've been trying to achieve 1) and 3), is by making the lower frame and frame ticks white. However, this has an unwanted side effect. The bottom of the two frames and the graph are now overlapped by this frame which makes it seem like it is cut off.

I haven't even tried 2) yet.

Is there a way to get the design I like without this effect? Perhaps by removing only the ticks and not the ticklabels? Ideas for 2) are welcome aswell. In particular I'm interested in implementations that do not require functions like ImageCompose or Overlay.

EDIT: I also don't want to use any (custom) packages like 'CustomTicks'

Is this ok?

layout = Overlay[{
Show[#, Frame -> {{True, True}, {True, False}},
FrameStyle -> {{Automatic, Automatic},
{{FontOpacity -> 1, Opacity@0}, Automatic}},
FrameTicks -> {{Automatic, All}, {All, None}},
Axes -> False]
,
Show[Delete[#, {1, 1}],
Axes -> {True, False},
TicksStyle -> FontOpacity -> 0]
}] &;

layout @ Plot[Sin[x], {x, 0, 10}]


• This seems to work! This does however make use of Overlay, but I guess it's very hard to do without using such a function? – Karel Apr 17 '15 at 10:04
• @Karel I don't think you can have FrameTicks and AxisTics generated at once. You could get FullGraphics from plot with Ticks and use Show instead of Overlay but I don't know it is stable enugh. Noone is using FullGraphics lately, afaict. – Kuba Apr 17 '15 at 10:17
Plot[Sin[x], {x, 0, 10}, Frame -> True,
FrameStyle -> {{Automatic, Black}, {White, White}},
FrameTicks -> {{Range[-1, 1, 0.5],
Range[-1, 1, 0.5]}, {({#, Style[#, Black]} & /@ Range[0, 10]),
None}}]


• Your plot has not ticks on axis. – Kuba Apr 17 '15 at 11:18
• @Kuba...oh! sorry but it matches the intended result on image...I am sorry I misinterpreted...just sought to reproduce image but not the text – ubpdqn Apr 17 '15 at 11:43

You can Inset the framed plot into a graphic with axes (while avoiding the use of Overlay as requested). Here is your plot, suitably modified to have the required frame ticks (and no axes):

p = Plot[Sin[x], {x, 0, 10},
Axes -> False,
Frame -> {{True, True}, {True, False}},
FrameTicks -> {{All, All}, {All, None}},
FrameStyle->{{Automatic,Automatic},{Directive[FontOpacity->1,Opacity[0]],None}}
]


In order to inset the plot, one needs to use the same PlotRange, ImagePadding, PlotRangePadding, and AspectRatio in both the graphic and the inset plot so that the axes and frame line up:

Graphics[
{
Inset[
{0, 0},
{0, 0},
ImageScaled[{1, 1}]
]
},
PlotRange -> {{0, 10}, {-1, 1}},
AspectRatio -> 1/GoldenRatio,
Axes -> {True, False},
Ticks -> Automatic,
TicksStyle -> FontOpacity -> 0,
]


Now, suppose that you instead just want to use the existing PlotRange, ImagePadding, and AspectRatio from the plot? This information can be extracted from the plot by using my graphicsInformation function from question 2091. Here is what graphicsInformation reveals about the plot p:

info = graphicsInformation[p]


{"ImagePadding" -> {{23., 24.}, {17., 0.5}}, "ImageSize" -> {360., 210.945}, "PlotRangeSize" -> {313., 193.445}, "ImagePaddingSize" -> {47., 17.5}, "PlotRange" -> {{-0.208333, 10.2083}, {-1.11111, 1.11111}}}

With the above information one does not need to override the options of the plot (using Show) to align the frame and axes:

Graphics[
{
Inset[p, {0, 0}, {0, 0}, ImageScaled[{1, 1}]]
},
Axes -> {True, False},
Ticks -> Automatic,
TicksStyle -> FontOpacity -> 0,
PlotRange -> ("PlotRange" /. info),