How can I put contour labels of contour plot around the frame?

I already defined a ContourPlot with log-log scale and labels, like this:

x := 412;
l := x/s*q;
ContourPlot[l, {s, 1000, 1000000}, {q, 1, 10},
ScalingFunctions -> {"Log", "Log"}, ContourShading -> None,
AspectRatio -> Automatic,
Contours -> {0.001, 0.002, 0.005, 0.01, 0.02, .05, 0.1, 0.2, 0.5, 1},
ContourLabels ->
Function[{x, y, z}, Text[Framed[z], {x, y}, Background -> White]],
FrameLabel -> {"x","y", "z"}, GridLines -> {{2, 6}},
GridLinesStyle -> Directive[Black, Thickness[0.001]]]


My actual problem is that it has to be a black/white plot. So I want to label the framed values outside (right and top) the frame of the ContourPlot on the position where the line ends. If this is done, it would be also very useful to set only the labels *10^3 so that the minimum value in the bottom right is "1" and so on.

The graph would maybe also look nicer, if the diagonal lines would end directly on the frame of the plot, that there is no space between.

• Although an automated MMA code would be very nice, if you are in a hurry I suggest a manual edit. Double click on the plot to enable the edit mode. Also, if you export the graphics as a PDF and open it in a professional PDF editor, you can manually make the changes you want there. – MathX Oct 24 '17 at 12:46
• What do you mean with an automated MMA code? This code should work?! Thanks for the hint with manually editing (this definitly works), but I'm not in hurry and would prefer a good formated graph with my requirements, if possible. – JinFins Oct 24 '17 at 13:17
• He meant that it would have been very convenient if Mathematica was "smart" enough to do this without user intervention. Altho, for something this finicky, I wouldn't count on automatic stuff. – J. M.'s technical difficulties Oct 24 '17 at 13:33
• Ok, thanks. But in order to add some correction terms in the defined equation and changing some values, it would be helpful to have a code which adapt changes in equations etc. – JinFins Oct 24 '17 at 14:52
• Including FrameTicks -> {{Automatic, None}, {Table[{10^(i + 2), i}, {i, 4}], None}} will get the tick labels working as you describe. – aardvark2012 Oct 25 '17 at 3:16