# Show seems to forget 'logness' for Ticks of LogLogPlot

So there is a (List)LogLogPlot I made a few months ago. Now, it turns out the axes I had back then are too small. Now, the creation of these plots costed quite some calculational time. So, instead of doing everything again, I execute

Show[*Paste old graph*,AxesStyle->Large,ImageSize->500]


Which kind of does what I expected it to do. The problem is, due to the increased size of my Tick-numbers, they overlap on the horizontal axis. So I want to reduce these labels from the default

{10,50,100,500,1000,5000,10000}


to

xlist={10,100,1000,10000}.


When I specify Ticks->{{xlist},{ylist}}

All ticks seem to dissapear (actually, one on the y-axis seems to remain, it is hard to read but it looks like it is in the wrong place).

When i specify Ticks->Automatic, ticks appear at natural numbers with even spacing, as if it were a normal plot instead of a LogLogPlot. The same behaviour when only the y-axis is set to automatic.

MWE: an example of this appears as well when comparing for example

LogLogPlot[10000/T^2, {T, 10, 10000}, PlotStyle -> {Red, Dashed},Ticks->Automatic, AxesStyle -> Large, ImageSize -> 500]


with

Show[LogLogPlot[10000/T^2, {T, 10, 10000}, PlotStyle -> {Red, Dashed}, AxesStyle -> Large, ImageSize -> 500],Ticks->Automatic]


Partial solution: To large extent, the problem can be solved by setting the graphics option

Ticks -> {{{Log[10], 10}, {Log[100], 100}, {Log[1000], 1000}, {Log[10000], 10000}}, ChartingScaledTicks[{Log, Exp}]}.


The only remaining issue is that this gives only ticks markers at the specified x-values, Whereas the default (ChartingScaledTicks) draws more unlabeled ticks markers without a label and with varying size. It would be nice to have these too on the x-axis: more ticks-markers with varying size and without label.

It would seem to me this could be obtained by, instead of giving an explicit list in Ticks right away, play with the options of

ChartingScaledTicks


which seems undocumented.

Options[ChartingScaledTicks]={Method->Automatic,TicksLength->Automatic,Object->None,Ticks->Automatic}.


Giving Charting an option like Ticks->{{Log[10],10},{Log[100],100}} or even TicksLength->Large doesn't seem to make a difference however.

• We're gonna need more data and code to judge. Jan 19 '17 at 10:06
• @Feyre added MWE Jan 19 '17 at 10:19
• You may be interested in Information[]. Jan 19 '17 at 12:51
• @Wouter I'd recommend using InputForm, instead, it is a bit easier on the eyes. Also, if you are looking for the options being passed to Graphics use Options, which is much easier than trying to read through the InputForm of the entire thing. Jan 19 '17 at 14:34
• @Wouter Rule is it's FullForm, i.e. a -> b is interpreted as Rule[a, b]. It's an important hurdle in understanding how mma processes its input, so keep comparing the FullForm to the InputForm it will save you from messes like this one: #[[1]] + 2^#&@#[[2]] & which got me yesterday. Plus has a higher precedence than Function, so that this is interpreted as (#[[1]] + 2^#)& @ #[[2]]&. Definitely not what I wanted. :) Jan 19 '17 at 15:09

This seems to work:

plot = LogLogPlot[10000/T^2, {T, 10, 10000},
PlotStyle -> {Red, Dashed}, Ticks -> Automatic, AxesStyle -> Large,
ImageSize -> 500]


Show[plot,
Ticks -> {Quiet[
ChartingScaledTicks[{Log, Exp}][#1, 1.1 #2, {6, 6}]] &,
Quiet[ChartingScaledTicks[{Log, Exp}][#1, #2, {6, 6}]] &}]


How did I do this? Admittedly, by try-and-error. If you do List @@ plot you can see all the options that are set of this plot. From there I saw how the ticks are specified and played with the numbers. The first item in the list given to Ticks specifies the x-axis ticks. Multiplying the second argument of the mysterios ScaledTicks function seems to change how many minor ticks are used between two major ticks. Multiplying this argument by 1.1 seems to lead to a major tick every 10 minor ticks.

• The usage of ScaledTicks, while undocumented, appears in several answers, The general form is ChartingScaledTicks[<scaling args>][min, max, divisions]. So your 1.1 #2 trick tells the ticks function that the range is a bit greater at the upper end (in fact, at T == 29427.3 == Exp[(1.1) (1 + 1/64) Log[10000]]). It does seem counterintuitive that increasing the range results in fewer major ticks. Jan 19 '17 at 18:27
• BTW, you can use just ChartingScaledTicks["Log"] for the vertical axis. Jan 19 '17 at 18:31
• Thanks for clarifying the arguments. Just for completeness, let me add that [<scaling args>] = [{function, inversefunction}, options]. Also, I found that divisions = {maximum number of major ticks, number of minor ticks between major ticks}. So I would expect setting divisions = {3,11} would do the job. In fact, changing the first number in divisions produces weird output (try 5 or 21 instead of 6), whereas the second number has absolutely no effect. Jan 19 '17 at 19:28
• Let's just say I said <scaling args> because there are several variants, not just that one. (But that one seems to be the most commonly used one.) Jan 19 '17 at 19:38
• Good to know. Maybe we should create our own documentation for such officially undocumented functions (maybe as a question "What is the definition of ..."). As it is now, one has to extract the definition and function arguments from a bunch of comments in a variety of questions. Jan 19 '17 at 19:42
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.633026123046875, "perplexity": 1830.7591088761276}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780057417.10/warc/CC-MAIN-20210923044248-20210923074248-00551.warc.gz"}