2

This question already has an answer here:

have produced a plot in matlab converted it to tikzpicture via matlab2tex. in matlab it looks fine but in tikzpicture the x-axis looks ugly (see picture) i want 0-10x10^9 and not 0-1x10^10 how can i do that

enter image description here

\begin{document}
% This file was created by matlab2tikz.
%
%The latest updates can be retrieved from
%  http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz-matlab2tikz
%where you can also make suggestions and rate matlab2tikz.
%
\definecolor{mycolor1}{rgb}{0.00000,0.44700,0.74100}%
\definecolor{mycolor2}{rgb}{0.85000,0.32500,0.09800}%
\definecolor{mycolor3}{rgb}{0.92900,0.69400,0.12500}%
%
\begin{tikzpicture}

\begin{axis}[%
width=4.521in,
height=3.566in,
at={(0.758in,0.481in)},
scale only axis,
xmin=0,
xmax=10000000000,
xlabel style={font=\color{white!15!black}},
xlabel={$\text{Intensity (W/cm}^\text{2}\text{)}$},
ymin=0,
ymax=50,
ylabel style={font=\color{white!15!black}},
ylabel={Energy (eV)},
axis background/.style={fill=white},
xmajorgrids,
xminorgrids,
ymajorgrids,
yminorgrids,
legend style={at={(0.03,0.97)}, anchor=north west, legend cell align=left, align=left, draw=white!15!black}
]
\addplot [color=mycolor1, line width=1.5pt]
  table[row sep=crcr]{%
0   0\\
100000000   4.73201859675128\\
200000000   6.69208487692737\\
300000000   8.19609663193401\\
400000000   9.46403719350257\\
500000000   10.581115253129\\
600000000   11.5910310154015\\
700000000   12.5197444063367\\
800000000   13.3841697538547\\
900000000   14.1960557902539\\
1000000000  14.9639566960079\\
1100000000  15.6943301864081\\
1200000000  16.392193263868\\
1300000000  17.0615356870359\\
1400000000  17.7055923368861\\
1500000000  18.3270292191615\\
1600000000  18.9280743870051\\
1700000000  19.5106124967926\\
1800000000  20.0762546307821\\
1900000000  20.626390862194\\
2000000000  21.1622305062581\\
2100000000  21.6848334095515\\
2200000000  22.1951346019798\\
2300000000  22.6939639552018\\
2400000000  23.182062030803\\
2500000000  23.6600929837564\\
2600000000  24.1286551635188\\
2700000000  24.588289895802\\
2800000000  25.0394888126735\\
2900000000  25.482700013931\\
3000000000  25.9183332797462\\
3100000000  26.3467645072407\\
3200000000  26.7683395077095\\
3300000000  27.1833772736207\\
3400000000  27.5921728031701\\
3500000000  27.9949995534917\\
3600000000  28.3921115805077\\
3700000000  28.7837454129931\\
3800000000  29.1701217001232\\
3900000000  29.5514466650958\\
4000000000  29.9279133920158\\
4100000000  30.2997029688411\\
4200000000  30.6669855055889\\
4300000000  31.0299210440504\\
4400000000  31.3886603728162\\
4500000000  31.7433457593871\\
4600000000  32.0941116094526\\
4700000000  32.4410850620012\\
4800000000  32.784386527736\\
4900000000  33.124130177259\\
5000000000  33.4604243846368\\
5100000000  33.7933721312331\\
5200000000  34.1230713740718\\
5300000000  34.4496153824684\\
5400000000  34.7730930462046\\
5500000000  35.0935891581354\\
5600000000  35.4111846737722\\
5700000000  35.7259569500944\\
5800000000  36.0379799655863\\
5900000000  36.3473245232713\\
6000000000  36.654058438323\\
6100000000  36.958246711661\\
6200000000  37.2599516907899\\
6300000000  37.5592332190102\\
6400000000  37.8561487740103\\
6500000000  38.1507535967509\\
6600000000  38.443100811459\\
6700000000  38.7332415374701\\
6800000000  39.0212249935852\\
6900000000  39.3070985955463\\
7000000000  39.5909080471767\\
7100000000  39.8726974256821\\
7200000000  40.1525092615642\\
7300000000  40.4303846135552\\
7400000000  40.7063631389492\\
7500000000  40.98048315967\\
7600000000  41.252781724388\\
7700000000  41.5232946669698\\
7800000000  41.7920566615236\\
7900000000  42.0591012742783\\
8000000000  42.3244610125162\\
8100000000  42.5881673707616\\
8200000000  42.8502508744115\\
8300000000  43.1107411209782\\
8400000000  43.369666819103\\
8500000000  43.6270558254852\\
8600000000  43.8829351798623\\
8700000000  44.1373311381647\\
8800000000  44.3902692039596\\
8900000000  44.6417741582926\\
9000000000  44.8918700880237\\
9100000000  45.1405804127506\\
9200000000  45.3879279104037\\
9300000000  45.6339347415933\\
9400000000  45.8786224727814\\
9500000000  46.1220120983463\\
9600000000  46.3641240616061\\
9700000000  46.6049782748582\\
9800000000  46.8445941384916\\
9900000000  47.0829905592243\\
10000000000 47.3201859675128\\
};
\addlegendentry{$\Delta\text{ W}_{\text{up}}\text{; W}_\text{0}\text{ = 30 eV}$}

\addplot [color=mycolor2, line width=1.5pt]
  table[row sep=crcr]{%
0   0\\
100000000   2.73203221064467\\
200000000   3.86367700513384\\
300000000   4.73201859675129\\
400000000   5.46406442128934\\
500000000   6.10900973972051\\
600000000   6.69208487692737\\
700000000   7.22827780318383\\
800000000   7.72735401026768\\
900000000   8.19609663193401\\
1000000000  8.63944442658207\\
1100000000  9.06112575787358\\
1200000000  9.46403719350257\\
1300000000  9.85048222169859\\
1400000000  10.222328501863\\
1500000000  10.581115253129\\
1600000000  10.9281288425787\\
1700000000  11.2644573770777\\
1800000000  11.5910310154015\\
1900000000  11.9086523166981\\
2000000000  12.218019479441\\
2100000000  12.5197444063367\\
2200000000  12.814366937153\\
2300000000  13.1023661985154\\
2400000000  13.3841697538547\\
2500000000  13.6601610532233\\
2600000000  13.9306855538412\\
2700000000  14.1960557902539\\
2800000000  14.4565556063677\\
2900000000  14.7124437127216\\
3000000000  14.9639566960079\\
3100000000  15.2113115805311\\
3200000000  15.4547080205354\\
3300000000  15.6943301864081\\
3400000000  15.9303483954369\\
3500000000  16.1629205281719\\
3600000000  16.392193263868\\
3700000000  16.6183031624772\\
3800000000  16.8413776158603\\
3900000000  17.0615356870359\\
4000000000  17.2788888531641\\
4100000000  17.4935416654261\\
4200000000  17.7055923368861\\
4300000000  17.9151332677153\\
4400000000  18.1222515157472\\
4500000000  18.3270292191615\\
4600000000  18.5295439771194\\
4700000000  18.72986919335\\
4800000000  18.9280743870051\\
4900000000  19.1242254745127\\
5000000000  19.3183850256692\\
5100000000  19.5106124967926\\
5200000000  19.7009644433972\\
5300000000  19.8894947145472\\
5400000000  20.0762546307821\\
5500000000  20.2612931472796\\
5600000000  20.4446570037259\\
5700000000  20.626390862194\\
5800000000  20.8065374341816\\
5900000000  20.9851375978334\\
6000000000  21.1622305062581\\
6100000000  21.3378536877541\\
6200000000  21.51204313867\\
6300000000  21.6848334095515\\
6400000000  21.8562576851574\\
6500000000  22.0263478588712\\
6600000000  22.1951346019798\\
6700000000  22.3626474282452\\
6800000000  22.5289147541554\\
6900000000  22.6939639552018\\
7000000000  22.8578214184992\\
7100000000  23.0205125920341\\
7200000000  23.182062030803\\
7300000000  23.3424934400762\\
7400000000  23.501829716003\\
7500000000  23.6600929837564\\
7600000000  23.8173046333963\\
7700000000  23.9734853536151\\
7800000000  24.1286551635188\\
7900000000  24.2828334425783\\
8000000000  24.436038958882\\
8100000000  24.588289895802\\
8200000000  24.7396038771845\\
8300000000  24.889997991161\\
8400000000  25.0394888126735\\
8500000000  25.1880924247947\\
8600000000  25.3358244389244\\
8700000000  25.482700013931\\
8800000000  25.628733874306\\
8900000000  25.7739403273927\\
9000000000  25.9183332797462\\
9100000000  26.0619262526775\\
9200000000  26.2047323970309\\
9300000000  26.3467645072407\\
9400000000  26.4880350347095\\
9500000000  26.6285561005474\\
9600000000  26.7683395077095\\
9700000000  26.907396752566\\
9800000000  27.0457390359369\\
9900000000  27.1833772736207\\
10000000000 27.3203221064467\\
};
\addlegendentry{$\Delta\text{ W}_{\text{low}}\text{; W}_\text{0}\text{ = 10 eV}$}

\addplot [color=mycolor3, line width=1.5pt]
  table[row sep=crcr]{%
0   0\\
100000000   0.0933\\
200000000   0.1866\\
300000000   0.2799\\
400000000   0.3732\\
500000000   0.4665\\
600000000   0.5598\\
700000000   0.6531\\
800000000   0.7464\\
900000000   0.8397\\
1000000000  0.933\\
1100000000  1.0263\\
1200000000  1.1196\\
1300000000  1.2129\\
1400000000  1.3062\\
1500000000  1.3995\\
1600000000  1.4928\\
1700000000  1.5861\\
1800000000  1.6794\\
1900000000  1.7727\\
2000000000  1.866\\
2100000000  1.9593\\
2200000000  2.0526\\
2300000000  2.1459\\
2400000000  2.2392\\
2500000000  2.3325\\
2600000000  2.4258\\
2700000000  2.5191\\
2800000000  2.6124\\
2900000000  2.7057\\
3000000000  2.799\\
3100000000  2.8923\\
3200000000  2.9856\\
3300000000  3.0789\\
3400000000  3.1722\\
3500000000  3.2655\\
3600000000  3.3588\\
3700000000  3.4521\\
3800000000  3.5454\\
3900000000  3.6387\\
4000000000  3.732\\
4100000000  3.8253\\
4200000000  3.9186\\
4300000000  4.0119\\
4400000000  4.1052\\
4500000000  4.1985\\
4600000000  4.2918\\
4700000000  4.3851\\
4800000000  4.4784\\
4900000000  4.5717\\
5000000000  4.665\\
5100000000  4.7583\\
5200000000  4.8516\\
5300000000  4.9449\\
5400000000  5.0382\\
5500000000  5.1315\\
5600000000  5.2248\\
5700000000  5.3181\\
5800000000  5.4114\\
5900000000  5.5047\\
6000000000  5.598\\
6100000000  5.6913\\
6200000000  5.7846\\
6300000000  5.8779\\
6400000000  5.9712\\
6500000000  6.0645\\
6600000000  6.1578\\
6700000000  6.2511\\
6800000000  6.3444\\
6900000000  6.4377\\
7000000000  6.531\\
7100000000  6.6243\\
7200000000  6.7176\\
7300000000  6.8109\\
7400000000  6.9042\\
7500000000  6.9975\\
7600000000  7.0908\\
7700000000  7.1841\\
7800000000  7.2774\\
7900000000  7.3707\\
8000000000  7.464\\
8100000000  7.5573\\
8200000000  7.6506\\
8300000000  7.7439\\
8400000000  7.8372\\
8500000000  7.9305\\
8600000000  8.0238\\
8700000000  8.1171\\
8800000000  8.2104\\
8900000000  8.3037\\
9000000000  8.397\\
9100000000  8.4903\\
9200000000  8.5836\\
9300000000  8.6769\\
9400000000  8.7702\\
9500000000  8.8635\\
9600000000  8.9568\\
9700000000  9.0501\\
9800000000  9.1434\\
9900000000  9.2367\\
10000000000 9.33\\
};
\addlegendentry{Ponderomotive Energy}

\end{axis}

\usetikzlibrary{calc}
\pgftransformreset
\node[inner sep=0pt,outer sep=0pt,minimum size=0pt,line width=0pt,text width=0pt,text height=0pt] at (current bounding box) {};
%add border to avoid cropping by pdflibnet
\foreach \border in {0.1}
  \useasboundingbox (current bounding box.south west)+(-\border,-\border) rectangle (current bounding box.north east)+(\border,\border);
\newwrite\metadatafile
\immediate\openout\metadatafile=\jobname_BB.txt
\path
  let
    \p1=(current bounding box.south west),
    \p2=(current bounding box.north east)
  in
  node[inner sep=0pt,outer sep=0pt,minimum size=0pt,line width=0pt,text width=0pt,text height=0pt,draw=white] at (current bounding box) {
\immediate\write\metadatafile{\p1,\p2}
};
\immediate\closeout\metadatafile
\end{tikzpicture}%

\end{document}

marked as duplicate by Dr. Manuel Kuehner, Schweinebacke, Bobyandbob, Troy, TeXnician Nov 21 '17 at 16:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Please you can add your complete compilable code? Thanks. – Sebastiano Nov 21 '17 at 10:19
  • this code was compiled using MikTeX and TeXnicCenter, I also use TikzEdt, both work. see also the picture. – Darwin Nov 21 '17 at 15:08
  • 1
    I think that @Sebastiano means that you should provide a code that people just can copy and paste and run without further modification (tex.meta.stackexchange.com/questions/228). Try it with the code that you provide (at least the pgfplots package is missing). I also changed your title to be more meaningful. – Dr. Manuel Kuehner Nov 21 '17 at 15:10
  • In addition, you may look at tex.stackexchange.com/questions/29283. – Dr. Manuel Kuehner Nov 21 '17 at 15:12

Browse other questions tagged or ask your own question.