%!TEX root = /Users/holene/Documents/NTNU/Master_thesis/tex/thesis.tex
% This file was created by matlab2tikz v0.3.3.
% Copyright (c) 2008--2013, Nico Schlmer <nico.schloemer@gmail.com>
% All rights reserved.
% 
% 
% 
\begin{tikzpicture}

\begin{axis}[%
width=6.01828521434821in,
height=4.74667979002625in,
unbounded coords=jump,
scale only axis,
xmin=1.2,
xmax=3,
xlabel={Robustness, $\Ms$},
ymin=0,
ymax=40,
ylabel={Controller $\Kc,\I,\D$},
title={Case 7},
clip=false,
% legend style={draw=black,fill=white,legend cell align=left}
]
\newcommand*\caseSevInpage[1][]{
\addplot [
color=blue,
dashed
]
table[row sep=crcr]{
1.24999999999996 0.745611902877131\\1.27500000002881 0.812839994468438\\1.30000000009104 0.878379687316929\\1.32499999999997 0.942228102527731\\1.34999999978483 1.00435886977375\\1.37499999995655 1.06479341909174\\1.39999999998848 1.12353248207459\\1.42499999987834 1.18074093206444\\1.44999999999961 1.23630467742836\\1.47500000000339 1.29041215962356\\1.5 1.34304435961393\\1.52499999975673 1.39430130327115\\1.54999999950468 1.44422890552085\\1.57500000000677 1.49290607403627\\1.59999999999998 1.54032847798041\\1.62500000021998 1.58653873019761\\1.64999999999957 1.6316608468275\\1.67500000000062 1.67569593594606\\1.70000000015178 1.71865403191869\\1.725 1.76062691255993\\1.75000000000015 1.80176695511762\\1.77500000000042 1.84188968249078\\1.79999999999942 1.88115908487526\\1.82500000000005 1.91945959147131\\1.84999999941752 1.95716956677061\\1.87500000000853 1.99398529317376\\1.8999999999813 2.02992443832545\\1.92499999996823 2.06476936368965\\1.95000000000001 2.09893813576231\\1.97499999999757 2.13257192881122\\2.00000000267699 2.16550243579657\\2.02500000000006 2.19776668832742\\2.05000000000009 2.22923796151115\\2.07499999999566 2.26005098300222\\2.09999999998694 2.29024425633803\\2.12499999999759 2.31854672857738\\2.14999999999327 2.34691745294733\\2.17499999988827 2.37464230296178\\2.20000000000015 2.40183934590555\\2.22499999977259 2.42853288727\\2.25 2.45472145616396\\2.27499999999391 2.48040907566671\\2.29999999999945 2.50565893045763\\2.32499999999965 2.53033948264744\\2.34999999999286 2.55442189116795\\2.375 2.57817108311629\\2.39999999985101 2.60140961549954\\2.42499999999864 2.62400560637014\\2.44999999973671 2.64642875607081\\2.47499999999592 2.66828749213887\\2.5 2.68961510750829\\2.5249999999891 2.71065963526236\\2.5499999991118 2.731113596727\\2.57499999996528 2.75149924268283\\2.59999999991795 2.77110410288674\\2.62499999997993 2.79036200663557\\2.64999999928606 2.80933367239563\\2.67499999999853 2.82793026871005\\2.7 2.84609637618286\\2.72499999999498 2.86415552501155\\2.74999999996091 2.88163914735911\\2.77499999999195 2.89892240840513\\2.7999999998123 2.91553918988034\\2.82500000000057 2.93228063048055\\2.8499999999256 2.94860457895\\2.87499999999331 2.96425878807622\\2.89999999998254 2.97996979293409\\2.92499999999822 2.99551966534142\\2.94999999991291 3.01017264674055\\2.97499999999005 3.02495109607619\\2.99999999999684 3.0397984430794\\};
% \addlegendentry{po:pid};

\addplot [
color=green!50!black,
dashed
]
table[row sep=crcr]{
1.24999999999996 0.635024657381267\\1.27500000002881 0.633697418911741\\1.30000000009104 0.632718388724299\\1.32499999999997 0.632039195537967\\1.34999999978483 0.631553669048891\\1.37499999995655 0.631183603875355\\1.39999999998848 0.630905115864966\\1.42499999987834 0.63067498976316\\1.44999999999961 0.630281100485019\\1.47500000000339 0.629873083924309\\1.5 0.629324174447383\\1.52499999975673 0.628795975578729\\1.54999999950468 0.628230279866169\\1.57500000000677 0.627582189630517\\1.59999999999998 0.62703811704915\\1.62500000021998 0.626571016084862\\1.64999999999957 0.625900178046253\\1.67500000000062 0.625246493822266\\1.70000000015178 0.62457311301243\\1.725 0.623873205419462\\1.75000000000015 0.622831407790706\\1.77500000000042 0.621989327388914\\1.79999999999942 0.621049246865624\\1.82500000000005 0.620288675831615\\1.84999999941752 0.61910183168431\\1.87500000000853 0.618066377207953\\1.8999999999813 0.617179435125081\\1.92499999996823 0.616801759188934\\1.95000000000001 0.61629032227759\\1.97499999999757 0.61548368635367\\2.00000000267699 0.614725722788667\\2.02500000000006 0.613955304432153\\2.05000000000009 0.613355759562293\\2.07499999999566 0.612789300246959\\2.09999999998694 0.612220765798917\\2.12499999999759 0.613033632873648\\2.14999999999327 0.61308902308947\\2.17499999988827 0.613168323938743\\2.20000000000015 0.613235931674145\\2.22499999977259 0.613229996375796\\2.25 0.613184579107527\\2.27499999999391 0.613118995985104\\2.29999999999945 0.61300100418168\\2.32499999999965 0.612927098609277\\2.34999999999286 0.61300861831737\\2.375 0.612911884527639\\2.39999999985101 0.612892228724944\\2.42499999999864 0.613037335485813\\2.44999999973671 0.612951347568334\\2.47499999999592 0.613016488180004\\2.5 0.613127424182388\\2.5249999999891 0.613171119439564\\2.5499999991118 0.613427195714807\\2.57499999996528 0.613331831266044\\2.59999999991795 0.613587616980474\\2.62499999997993 0.61382730638864\\2.64999999928606 0.61398262729681\\2.67499999999853 0.614225529737094\\2.7 0.614469244684052\\2.72499999999498 0.614606411162592\\2.74999999996091 0.614920167864672\\2.77499999999195 0.615127684740388\\2.7999999998123 0.615568661331254\\2.82500000000057 0.615732439447951\\2.8499999999256 0.615985238771474\\2.87499999999331 0.616451187928314\\2.89999999998254 0.616738988330614\\2.92499999999822 0.616951662736851\\2.94999999991291 0.617517404969637\\2.97499999999005 0.617861932910349\\2.99999999999684 0.618034479394841\\};
% \addlegendentry{Smith:pid};

\addplot [
color=red,
dashed,
forget plot
]
table[row sep=crcr]{
1.24999999999996 0.635024325386883\\1.27500000002881 0.633696144305752\\1.30000000009104 0.632721703385603\\1.32499999999997 0.632038072892169\\1.34999999978483 0.631558620927282\\1.37499999995655 0.631190389730661\\1.39999999998848 0.630954691998432\\1.42499999987834 0.630659535700375\\1.44999999999961 0.630280905177126\\1.47500000000339 0.629844715493878\\1.5 0.629308668569611\\1.52499999975673 0.628786516526198\\1.54999999950468 0.628229959000748\\1.57500000000677 0.627581050607323\\1.59999999999998 0.627037977268423\\1.62500000021998 0.626570976840066\\1.64999999999957 0.625902081405486\\1.67500000000062 0.625239864953679\\1.70000000015178 0.624575355231607\\1.725 0.623870092035309\\1.75000000000015 0.62283312846033\\1.77500000000042 0.621989929933379\\1.79999999999942 0.621049897468372\\1.82500000000005 0.620288094771512\\1.84999999941752 0.619100504068653\\1.87500000000853 0.61806580858693\\1.8999999999813 0.617180386068495\\1.92499999996823 0.616795316497556\\1.95000000000001 0.616280968497415\\1.97499999999757 0.615484647080352\\2.00000000267699 0.614724992612884\\2.02500000000006 0.613955353318735\\2.05000000000009 0.613357212559021\\2.07499999999566 0.612788894571061\\2.09999999998694 0.612219686596695\\2.12499999999759 0.613034239558822\\2.14999999999327 0.613089324699239\\2.17499999988827 0.613177655159259\\2.20000000000015 0.613236649756574\\2.22499999977259 0.613229666659407\\2.25 0.613185599055203\\2.27499999999391 0.613120881966891\\2.29999999999945 0.613000384486852\\2.32499999999965 0.612934185666427\\2.34999999999286 0.612997315315449\\2.375 0.612912657957858\\2.39999999985101 0.612891289602614\\2.42499999999864 0.613029802195799\\2.44999999973671 0.612952321089478\\2.47499999999592 0.613006681881942\\2.5 0.613126992412419\\2.5249999999891 0.61317167698188\\2.5499999991118 0.613394205124185\\2.57499999996528 0.613331347133921\\2.59999999991795 0.613585223126646\\2.62499999997993 0.613824361732148\\2.64999999928606 0.613998010668253\\2.67499999999853 0.614224601087506\\2.7 0.614481152817382\\2.72499999999498 0.614614329644302\\2.74999999996091 0.614914286247876\\2.77499999999195 0.61512680946274\\2.7999999998123 0.615562543293397\\2.82500000000057 0.615733876872767\\2.8499999999256 0.615986479232209\\2.87499999999331 0.616455394792351\\2.89999999998254 0.616737521792224\\2.92499999999822 0.616951767183612\\2.94999999991291 0.617515908003058\\2.97499999999005 0.617861958223209\\2.99999999999684 0.618034787028863\\};
\addplot [
color=blue,
solid,
forget plot
]
table[row sep=crcr]{
1.25 1.1339516386429\\1.26 1.20030365853572\\1.27 1.26885627589146\\1.28 1.34789209427183\\1.29 1.40131570836158\\1.3 1.46746060756911\\1.31 1.53914841783542\\1.32 1.62094752235654\\1.33 1.69650704439424\\1.34 1.76330503538912\\1.35 1.84002829628064\\1.36 1.89370909994507\\1.37 2.02081495490984\\1.38 2.12156198000229\\1.39 2.1991443648615\\1.4 2.27166966593795\\1.41 2.40903883200075\\1.42 2.54170339659851\\1.43 2.62240716195936\\1.44 2.68212063160506\\1.45 2.85002372995743\\1.46 2.97858736452106\\1.47 3.09433648891964\\1.48 3.22155030895488\\1.49 3.44155853985721\\1.5 3.51046289801757\\1.51 3.59825490170597\\1.52 3.7250553817719\\1.53 3.8872245595507\\1.54 3.89887139715428\\1.55 4.08415356352086\\1.56 4.24966864951603\\1.57 4.46629577241049\\1.58 4.62699939029194\\1.59 4.75417627222358\\1.6 4.90745472230411\\1.61 5.04393731241651\\1.62 5.19831195274108\\1.63 5.62494650942487\\1.64 5.69443524795031\\1.65 5.85928255265645\\1.66 6.08075766241132\\1.67 6.28412385745745\\1.68 6.47068146771827\\1.69 6.90528871714273\\1.7 7.25862913289158\\1.71 7.28563991481564\\1.72 7.66177197628191\\1.73 7.81457316145452\\1.73999999999999 8.18802495925469\\1.75000000000001 8.57476533066906\\1.76 8.75289795396668\\1.77 9.08275715529858\\1.78 9.46156290025882\\1.79 9.7037187362572\\1.8 9.9600677255941\\1.81 10.1678490570832\\1.82 10.8966538962002\\1.83 13.1399101191684\\1.83999999999999 14.3397975605638\\1.85 13.3597777913786\\1.86 14.964939950185\\1.87 16.3003802569469\\1.88 17.934844530761\\1.89 17.3526254459456\\1.9 19.3563480579299\\1.91 20.4158370121628\\1.92 23.2363879330037\\1.93000000000001 22.9023694942666\\1.94 25.627283978228\\1.95 28.8870651658638\\1.96000000000001 22.6380534917887\\1.97000000000002 24.7222376812073\\1.98000000000001 28.8562166218657\\1.99000000000002 38.057010676051\\};
\addplot [
color=green!50!black,
solid,
forget plot
]
table[row sep=crcr]{
1.25 0.627366710461959\\1.26 0.626738347501058\\1.27 0.626089606763002\\1.28 0.629515238966055\\1.29 0.619790126358391\\1.3 0.616318978067021\\1.31 0.614372258779815\\1.32 0.614291750289585\\1.33 0.612488610333023\\1.34 0.607541371004864\\1.35 0.603270165121627\\1.36 0.594712487201591\\1.37 0.604548351093434\\1.38 0.607945036160958\\1.39 0.601216226376466\\1.4 0.597410135670853\\1.41 0.604247892166114\\1.42 0.614992689234869\\1.43 0.606327276239992\\1.44 0.593115384530937\\1.45 0.609596856502366\\1.46 0.610192165932544\\1.47 0.606625071596848\\1.48 0.613933519108493\\1.49 0.629876578542927\\1.5 0.61335927055673\\1.51 0.602920521985437\\1.52 0.611917202319059\\1.53 0.611835649875473\\1.54 0.589163098403094\\1.55 0.591258733770063\\1.56 0.59450455516324\\1.57 0.612029708852781\\1.58 0.61404205118268\\1.59 0.599957939668267\\1.6 0.597418386286479\\1.61 0.587406802169296\\1.62 0.5875021193112\\1.63 0.629410227683611\\1.64 0.61984968369708\\1.65 0.605050600764073\\1.66 0.606982006185213\\1.67 0.597984423299676\\1.68 0.59718190493999\\1.69 0.626676280869168\\1.7 0.640755099253914\\1.71 0.650882859750172\\1.72 0.659121969061064\\1.73 0.635507485179352\\1.73999999999999 0.639012794370579\\1.75000000000001 0.637098828031466\\1.76 0.614818052602437\\1.77 0.617438687106627\\1.78 0.642009778010157\\1.79 0.652027087590544\\1.8 0.694938865989811\\1.81 0.661668258223988\\1.82 0.704170538470423\\1.83 0.853047723952167\\1.83999999999999 0.922785485676934\\1.85 0.836995272555406\\1.86 0.895773766025177\\1.87 0.951718215351615\\1.88 0.999791341483653\\1.89 0.9023347425101\\1.9 0.972027799182537\\1.91 0.939280669709878\\1.92 1.0299748583198\\1.93000000000001 0.91907403028072\\1.94 0.954415146340829\\1.95 0.974151221266383\\1.96000000000001 0.72549213021104\\1.97000000000002 0.725399071919115\\1.98000000000001 0.736363737456271\\1.99000000000002 0.772205233382454\\};
\addplot [
color=red,
solid,
forget plot
]
table[row sep=crcr]{
1.25 0.573831203813138\\1.26 0.568944691738086\\1.27 0.563698659893475\\1.28 0.554814988343255\\1.29 0.55812814908956\\1.3 0.558206864080669\\1.31 0.55622167019791\\1.32 0.548465976677564\\1.33 0.547198087010686\\1.34 0.550436612870347\\1.35 0.546606667490642\\1.36 0.556326942653253\\1.37 0.538606673954082\\1.38 0.534505682532994\\1.39 0.533262171902332\\1.4 0.540296369977131\\1.41 0.524178954187726\\1.42 0.519295974689504\\1.43 0.519569582147599\\1.44 0.524851189645995\\1.45 0.515762119904106\\1.46 0.508710684671042\\1.47 0.504210170536091\\1.48 0.508127957955918\\1.49 0.488669654734263\\1.5 0.492802970244311\\1.51 0.496257299965236\\1.52 0.50604577770628\\1.53 0.498341331748161\\1.54 0.513448681574616\\1.55 0.503386254250407\\1.56 0.501335192497165\\1.57 0.50000864787378\\1.58 0.500744520173909\\1.59 0.497738175879226\\1.6 0.498616665094047\\1.61 0.497917838033604\\1.62 0.502264307717079\\1.63 0.488403081015407\\1.64 0.502965913597337\\1.65 0.499033331651174\\1.66 0.497869813995591\\1.67 0.493604275729248\\1.68 0.498139596547938\\1.69 0.488938439265881\\1.7 0.483527289057083\\1.71 0.515752111112699\\1.72 0.506973266121269\\1.73 0.509286100540978\\1.73999999999999 0.502141560121213\\1.75000000000001 0.493109581506891\\1.76 0.495459399241393\\1.77 0.497523102531567\\1.78 0.508040696038865\\1.79 0.524191050936475\\1.8 0.553413730580852\\1.81 0.556352373758822\\1.82 0.55109310879046\\1.83 0.481069862140253\\1.83999999999999 0.463524867931305\\1.85 0.536674886151714\\1.86 0.499309483037419\\1.87 0.48388778336214\\1.88 0.459504006351576\\1.89 0.510259560953539\\1.9 0.4859083429269\\1.91 0.486685739926349\\1.92 0.456174068549457\\1.93000000000001 0.505173501565925\\1.94 0.489416338115358\\1.95 0.470752560768283\\1.96000000000001 0.68346063927786\\1.97000000000002 0.718867428710031\\1.98000000000001 0.735808024060674\\1.99000000000002 0.736605319704421\\};
}
% \newcommand*\spyfactor{3.1622776601683793319988935444327}
\newcommand*\spyfactor{2}
\newcommand*\spypoint{axis cs:1.8,1.2}
\newcommand*\spyviewer{axis cs:2.65,15}
\caseSevInpage
\node[very thin, rectangle, draw, minimum height=0.05\textwidth, minimum width=0.2\textwidth, inner sep=0pt] (spypoint) at (\spypoint) {};
\node[rectangle, draw, fill=white,minimum height=0.25\textwidth, minimum width=0.6\textwidth, inner sep=0pt] (spyviewer) at (\spyviewer) {};
\draw (spypoint) edge (spyviewer);
\begin{scope}
    \clip (spyviewer.south west) rectangle (spyviewer.north east);
    \pgfmathparse{\spyfactor^2/(\spyfactor-1)}
    \begin{scope}[scale around={\spyfactor:($(\spyviewer)!\spyfactor^2/(\spyfactor^2-1)!(\spypoint)$)}]
        \caseSevInpage
    \end{scope}
\end{scope}
\node[Knode] at (axis cs:2.8,4) {$\Kc^\text{po:pid}$} ;
\node[Inode] at (axis cs:2.8,1.9) {$\I^\text{po:pid}$} ;
\node[Dnode] at (axis cs:2.8,15.5) {$\D^\text{po:pid}$} ;
\node[Knode] at (axis cs:2,25) {$\Kc^\text{smith:po:pid}$} ;
\node[Inode] at (axis cs:2.8,9.7) {$\I^\text{smith:po:pid}$} ;
\node[Dnode] at (axis cs:2.4,15.5) {$\D^\text{smith:po:pid}$} ;

\end{axis}
% \node[very thin, draw, rectangle, minimum width=0.2\textwidth,minimum height=0.05\textwidth, inner sep=0pt] (box) at (rel axis cs:0.15,0.04) {} ;
% \node[inner sep = 2pt] at (rel axis cs:0.7,0.5) (largePlot)
%     {\pgfplotsset{execute at begin axis={\pgfplotsset{
%     width=0.35\textwidth, 
%     height=0.5\textwidth,
%     xlabel={\empty},ylabel={\empty},
%     title={\empty}
%     }}} %<-- Only inside this group
%     \graphsize{1.2}{1.7}{0}{4}{\input{../matlab/newWorldOrder/results/merged/tuning/case7_pid}}
%     } ;
% \node at (rel axis cs:1,0.2) (1) {};
% \node at (rel axis cs:2.1,0.2) (2) {};

% \draw[dashed] (box.north east) -- (1) ;
% \draw[dashed] (box.south east) -- (2) ;
\end{tikzpicture}%