Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem with pgfplots. As you can see by compiling my MWE, the title of the plot covers the scientific notation of the y axis. Is there any way to fix that (move the title or the scientific notation, ...)? I know that changing units would be a solution, but I love SI units without prefix and scientific notation.

\documentclass[%
    10pt,%
    a4paper,%
    onside,%
    headinclude,%
    footinclude,%
    BCOR5mm,%
    captions=tableheading]%
        {scrartcl}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[french]{babel}

\usepackage{amsmath}

    \renewcommand{\vec}{\mathbold}
    \newcommand{\mydef}{\equiv}

\usepackage[%
    output-decimal-marker={,}]
        {siunitx}

\usepackage{pgfplots}
    \pgfplotsset{%
        compat=newest,%
        /pgf/number format/use comma,%
        /pgf/number format/1000 sep={\,},%
        /pgf/number format/min exponent for 1000 sep=4}

\usepackage[%
    nochapters,%
    beramono,%
    eulermath,%
    pdfspacing,%
    listings]%
        {classicthesis}

\usepackage{filecontents}

\author{Authors}
\title{Title}
\date{}

\begin{filecontents}{magnus_nog_not_dt1s.dat}
0 0 0 0 20 0 0 85.070023030749 0 85.070023030749 0 0 0
1 20 0 0 20 7.9671445572141e-16 -13.011334472537 85.070023030749 -0 85.070023030749 -7.105427357601e-15 0 -1.4210854715202e-14
2 40 7.9671445572141e-16 -13.011334472537 11.535258762188 1.5934289114428e-15 -26.022668945074 120.62193622956 -0 120.62193622956 -7.105427357601e-15 35.551913198809 -1.4210854715202e-14
3 51.535258762188 2.3901433671642e-15 -39.034003417611 -5.3942237134348 2.0529442817589e-15 -33.527124444179 171.22073671522 -0 171.22073671522 0 86.15071368447 0
4 46.141035048754 4.4430876489232e-15 -72.56112786179 -27.205855215714 1.8380614812645e-15 -30.01782199642 243.23482485362 -0 243.23482485362 1.4210854715202e-14 158.16480182287 2.8421709430404e-14
5 18.93517983304 6.2811491301877e-15 -102.57894985821 -46.734451322339 7.5429657473335e-16 -12.318597905266 345.72794407044 -0 345.72794407044 0 260.6579210397 0
6 -27.799271489299 7.035445704921e-15 -114.89754776348 -54.748521201244 -1.1074040727024e-15 18.085280972007 491.5999499286 0 491.5999499286 0 406.52992689785 0
7 -82.547792690544 5.9280416322186e-15 -96.812266791469 -42.982839213415 -3.2883509862225e-15 53.702847033316 699.21039495825 0 699.21039495825 0 614.1403719275 0
8 -125.53063190396 2.6396906459961e-15 -43.109419758153 -8.0455539695163 -5.0006034536863e-15 81.666051912567 994.68927476004 0 994.68927476004 0 909.61925172929 0
9 -133.57618587347 -2.3609128076902e-15 38.556632154414 45.083661854783 -5.3211039112763e-15 86.900221598278 1415.2257674999 0 1415.2257674999 0 1330.1557444691 0
10 -88.492524018692 -7.6820167189666e-15 125.45685375269 101.61805430242 -3.5251636554483e-15 57.570291416311 2013.7488898447 0 2013.7488898447 0 1928.6788668139 0
11 13.12553028373 -1.1207180374415e-14 183.027145169 139.07137016737 5.2286498580285e-16 -8.5390332325514 2865.5891799642 -0 2865.5891799642 0 2780.5191569335 0
12 152.1969004511 -1.0684315388612e-14 174.48811193645 133.51615929433 6.0628735352694e-15 -99.014238872638 4077.959851674 -0 4077.959851674 0 3992.8898286433 0
13 285.71305974544 -4.6214418533427e-15 75.473873063814 69.100790318554 1.1381586244379e-14 -185.87540917599 5803.4507244006 -0 5803.4507244006 0 5718.3807013699 0
14 354.81385006399 6.7601443910366e-15 -110.40153611218 -51.823565631872 1.4134266171808e-14 -230.83008393356 8259.233284419 -0 8259.233284419 -2.2737367544323e-13 8174.1632613882 -4.5474735088646e-13
15 302.99028443212 2.0894410562844e-14 -341.23162004574 -201.99393705104 1.2069836977511e-14 -197.11539663377 11754.394039782 -0 11754.394039782 -9.0949470177293e-13 11669.324016751 -1.8189894035459e-12
16 100.99634738108 3.2964247540355e-14 -538.34701667951 -330.23065481548 4.0232624966783e-15 -65.704862813988 16728.836364079 -0 16728.836364079 4.5474735088646e-13 16643.766341049 9.0949470177293e-13
17 -229.2343074344 3.6987510037033e-14 -604.0518794935 -372.97605214273 -9.1317143240137e-15 149.13221233047 23808.647042257 0 23808.647042257 0 23723.577019226 0
18 -602.21035957713 2.7855795713019e-14 -454.91966716303 -275.95559737967 -2.3989484943014e-14 391.77802056425 33884.895990608 0 33884.895990608 0 33799.825967577 0
19 -878.16595695681 3.8663107700047e-15 -63.141646598785 -21.077854152176 -3.4982375621496e-14 571.30554941803 48225.786938737 0 48225.786938737 0 48140.716915706 0
20 -899.24381110898 -3.1116064851491e-14 508.16390281925 350.59452532255 -3.5822027176427e-14 585.0180999349 68636.274436645 0 68636.274436645 -3.6379788070917e-12 68551.204413614 -7.2759576141834e-12
21 -548.64928578643 -6.6938092027918e-14 1093.1820027541 731.1878338596 -2.1855840855364e-14 356.93296827429 97685.236694923 0 97685.236694923 7.2759576141834e-12 97600.166671892 1.4551915228367e-11
22 182.53854807317 -8.8793932883281e-14 1450.1149710284 963.39654558422 7.2715549988147e-15 -118.75350515557 139028.79639036 -0 139028.79639036 1.8189894035459e-12 138943.72636733 3.6379788070917e-12
23 1145.9350936574 -8.1522377884467e-14 1331.3614658729 886.13946681596 4.5649152721765e-14 -745.50723936972 197870.4828194 -0 197870.4828194 0 197785.41279637 0
24 2032.0745604733 -3.5873225162701e-14 585.85422650314 401.13726465909 8.0949158871642e-14 -1322.0000889726 281616.15172935 -0 281616.15172935 0 281531.08170632 0
25 2433.2118251324 4.5075933708941e-14 -736.14586246948 -458.91200185823 9.6928751745764e-14 -1582.9666449665 400806.09149481 -0 400806.09149481 0 400721.02147178 0
26 1974.2998232742 1.420046854547e-13 -2319.112507436 -1488.7374256847 7.8647660456539e-14 -1284.4137674846 570441.63117352 -0 570441.63117352 -2.9103830456734e-11 570356.56115049 -5.8207660913467e-11
27 485.5623975895 2.2065234591124e-13 -3603.5262749206 -2324.3342821784 1.9342729065715e-14 -315.8907381162 811873.21825806 -0 811873.21825806 0 811788.14823503 0
28 -1838.7718845889 2.3999507497696e-13 -3919.4170130368 -2529.8422846987 -7.3248807061302e-14 1196.2438004542 1155487.6009078 0 1155487.6009078 -5.8207660913467e-11 1155402.5308848 -1.1641532182693e-10
29 -4368.6141692876 1.6674626791566e-13 -2723.1732125826 -1751.6058747783 -1.7402690300704e-13 2842.0750069033 1644532.3252937 0 1644532.3252937 0 1644447.2552706 0
30 -6120.2200440659 -7.2806350913816e-15 118.90179432062 97.353550764521 -2.4380338906516e-13 3981.6115019433 2340558.9019617 0 2340558.9019617 0 2340473.8319386 0
31 -6022.8664933013 -2.5108402415654e-13 4100.5132962639 2687.6575003388 -2.3992524000466e-13 3918.276521389 3331169.7219363 0 3331169.7219363 0 3331084.6519133 0
32 -3335.2089929626 -4.910092641612e-13 8018.789817653 5236.7578191229 -1.3286046087727e-13 2169.7759871625 4741043.7548341 0 4741043.7548341 0 4740958.6848111 0
33 1901.5488261603 -6.2386972503847e-13 10188.565804815 6648.3418740954 7.57495719031e-14 -1237.0843896516 6747628.7310514 -0 6747628.7310514 0 6747543.6610284 0
34 8549.8907002557 -5.4812015313537e-13 8951.4814151638 5843.5359358698 3.4059107578659e-13 -5562.2743802331 9603474.8370367 -0 9603474.8370367 0 9603389.7670136 0
35 14393.426636125 -2.0752907734878e-13 3389.2070349308 2224.905316408 5.7337255341834e-13 -9363.8844084276 13668020.858131 -0 13668020.858131 0 13667935.788108 0
36 16618.331952533 3.6584347606955e-13 -5974.6773734969 -3866.9262836034 6.6200326482802e-13 -10811.333770503 19452833.395112 -0 19452833.395112 -9.3132257461548e-10 19452748.325089 -1.862645149231e-09
37 12751.40566893 1.0278467408976e-12 -16786.011144 -10900.420272716 5.0796146136023e-13 -8295.6402076728 27685992.993832 -0 27685992.993832 1.862645149231e-09 27685907.923809 3.7252902984619e-09
38 1850.9853962142 1.5358082022578e-12 -25081.651351673 -16297.287743009 7.3735341124651e-14 -1204.1895046962 39403730.871192 -0 39403730.871192 0 39403645.801169 0
39 -14446.302346795 1.6095435433825e-12 -26285.840856369 -17080.693363705 -5.7547889557067e-13 9398.2835862771 56080849.699769 0 56080849.699769 -3.7252902984619e-09 56080764.629746 -7.4505805969238e-09
40 -31526.9957105 1.0340646478118e-12 -16887.557270092 -10966.482803265 -1.2559006614011e-12 20510.414305178 79816343.302153 0 79816343.302153 -3.7252902984619e-09 79816258.23213 -7.4505805969238e-09
41 -42493.478513764 -2.2183601358931e-13 3622.8570350857 2376.9102314842 -1.6927584302901e-12 27644.843092208 113597577.47933 0 113597577.47933 0 113597492.40931 0
42 -40116.56828228 -1.9145944438795e-12 31267.700127293 20361.72522716 -1.5980724932214e-12 26098.504390556 161676281.9567 0 161676281.9567 0 161676196.88668 0
43 -19754.84305512 -3.5126669371008e-12 57366.204517849 37340.543720085 -7.8694845162608e-13 12851.843522132 230103676.05657 0 230103676.05657 0 230103590.98655 0
44 17585.700664965 -4.2996153887269e-12 70218.048039981 45701.525452844 7.0053909668838e-13 -11440.671664289 327492079.3881 -0 327492079.3881 0 327491994.31808 0
45 63287.226117809 -3.5990762920385e-12 58777.376375692 38258.605172116 2.5210923955284e-12 -41172.563342895 466098864.40789 -0 466098864.40789 2.9802322387695e-08 466098779.33786 5.9604644775391e-08
46 101545.83128993 -1.0779838965101e-12 17604.813032797 11473.10553481 4.0451515853465e-12 -66062.338760252 663369177.87754 -0 663369177.87754 -1.4901161193848e-08 663369092.80752 -2.9802322387695e-08
47 113018.93682474 2.9671676888364e-12 -48457.525727455 -31504.853747574 4.5021910369266e-12 -73526.359437859 944131599.21833 -0 944131599.21833 0 944131514.14831 0
48 81514.083077161 7.469358725763e-12 -121983.88516531 -79338.656507272 3.2471724166225e-12 -53030.349956956 1343723082.8567 -0 1343723082.8567 0 1343722997.7867 0
49 2175.4265698887 1.0716531142385e-11 -175014.23512227 -113838.43753155 8.6659689779539e-14 -1415.2601360633 1912436491.9866 -0 1912436491.9866 0 1912436406.9166 0
50 -111663.01096167 1.0803190832165e-11 -176429.49525833 -114759.15868135 -4.4481767501269e-12 72644.23919164 2721850493.4545 0 2721850493.4545 -2.3841857910156e-07 2721850408.3845 -4.7683715820312e-07
\end{filecontents}

\begin{document}

\begin{figure}
\centering
\begin{tikzpicture}
    \begin{axis}[title={Trajectoire de la balle dans le plan $x$-$z$}, xlabel={$x$}, ylabel={$z$},%
    legend cell align=left]

        \addplot[orange,thick]
            table[x index=1,y index=3] {magnus_nog_not_dt1s.dat};

        \legend{}
    \end{axis}
    \end{tikzpicture}
\caption[]{}\label{g:nognot}
\end{figure}

\end{document}
share|improve this question
1  
That's more of a WE but definitely not a MWE. –  percusse Oct 9 '12 at 19:16
3  
Adding title style={yshift=1.5ex} to your axis options will shift the title up. –  Jake Oct 9 '12 at 19:18
    
Thanks for providing the code, but as @percusse commented, you should try to MWE, with emphasis on the M part of the MWE. Please make an attempt to reduce your code to only what is needed to reproduce the problem. Besides the numerous extraneous packages you don't really need to provide that much data. –  Peter Grill Oct 10 '12 at 7:46
    
While pgfplots ability to 'divide through' is handy, for a 'proper' presentation of data I would recommend dividing though as part of the axis itself (e.g. '$z/10^5$ with appropriate expression used for the data). –  Joseph Wright Oct 10 '12 at 7:49
1  
@Luigi: Maybe instead of changing the /.code key, using something like y tick scale label style={xshift=-1cm} would be more intuitive. –  Jake Oct 10 '12 at 8:45
add comment

1 Answer 1

up vote 6 down vote accepted

You have several options.

1. Move Title:

As Jake says you can use title style={yshift=1.5ex}, and that certainly is one solution in that the title does get out of the way, but in this case using an x shift is actually better. So using title style={xshift=1.5em} yields:

enter image description here

Combining the two and usinf title style={xshift=1.5em, yshift=-1.5ex} also produces a usable result:

enter image description here

2. Wider Plot:

Another option is that you could just make the plot wider by using width=10cm option:

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.