How to add vertical axis break to given plotting scheme

2 views (last 30 days)
The given code below generates a standard plot from the columns of Mat1. I am attempting to introduce a break in the vartical axis from approximately y=1 to y=700, so as to showcase the behavior of each of the column vectors being plotted. I will also include a screenshot of the form that this vertical break should have. I have already attempted to use the BreakPlot function, which seemingly cannot parse the NaN entries.
Mat1 = [
0, 0, 0.024878847, 97.10533816, 0.057300870, 64501.67413, NaN, NaN;
0.5, 0, 0.023545822, 0.036651519, 0.054906123, 63149.44567, NaN, NaN;
1, 0, 0.022348502, 0.035331751, 0.052702120, 61876.00859, NaN, NaN;
1.5, 0, 0.021267149, 0.034103655, 0.050667134, 60673.83195, NaN, NaN;
2, 0, 0.020285678, 0.032958013, 0.048782582, 59536.32244, NaN, NaN;
3, 0, 0.018571671, 0.030883004, 0.045403028, 57432.81213, NaN, NaN;
4, 0, 0.017124857, 0.029053722, 0.042459591, 55526.75927, NaN, NaN;
6, 0, 0.014816513, 0.025976328, 0.037583083, 52190.99906, NaN, NaN;
8, 0, 0.013056669, 0.023488390, 0.033708882, 49349.80021, NaN, NaN;
10, 0, 0.011670552, 0.021435390, 0.030557359, 46883.53017, NaN, NaN;
12, 0, 0.010550524, 0.019712455, 0.027943868, 44709.01561, NaN, NaN;
14, 0, 0.009626668, 0.018245915, 0.025741641, 42766.42205, NaN, NaN;
16, 0, 0.008851590, 0.016982502, 0.023860789, 41011.44214, NaN, NaN;
18, 0, 0.008192027, 0.015882746, 0.022235813, 39410.44079, NaN, NaN;
20, 0, 0.007623945, 0.014916781, 0.020817867, 37937.32372, NaN, NaN;
22, 0, 0.007129544, 0.014061591, 0.019569785, 36571.45114, NaN, NaN;
24, 0, 0.006695363, 0.013299153, 0.018462787, 35296.20732, NaN, NaN;
26, 0, 0.006311030, 0.012615153, 0.017474246, 34097.99429, NaN, NaN;
28, 0, 0.005968426, 0.011998079, 0.016586124, 32965.50684, NaN, NaN;
30, 0, 0.005661105, 0.011438564, 0.015783866, 31889.19783, NaN, NaN;
32, 0, 0.005383883, 0.010928914, 0.015055600, 30860.87470, NaN, NaN;
34, 0, 0.005132546, 0.010462747, 0.014391545, 29873.38682, NaN, NaN;
36, 0, 0.004903628, 0.010034725, 0.013783571, 28920.37578, NaN, NaN;
38, 0, 0.004694259, 0.009640350, 0.013224864, 27996.06801, NaN, NaN;
40, 0, 0.004502037, 0.009275804, 0.01270967, 27095.09374, NaN, NaN;
42, 0, 0.004324938, 0.008937826, 0.012233099, 26212.31798, NaN, NaN;
44, 0, 0.004161245, 0.008623613, 0.011790965, 25342.66960, NaN, NaN;
46, 0, 0.004009491, 0.008330745, 0.011379667, 24480.95163, NaN, NaN;
48, 0, 0.003868417, 0.008057116, 0.010996088, 23621.60932, NaN, NaN;
50, 0, 0.003736932, 0.007800893, 0.010637519, 22758.41961, NaN, NaN;
54, 0, 0.003499071, 0.007334414, 0.009986224, 20989.28197, NaN, NaN;
58, 0, 0.003289678, 0.006920579, 0.009410066, 19084.26102, NaN, NaN;
62, 0, 0.003103932, 0.006550953, 0.008896753, 16843.62970, NaN, NaN;
63, 0, 0.003060727, 0.006464635, 0.008777056, 16172.39739, NaN, NaN;
64, 0, 0.003018709, 0.006380562, 0.008660536, 15414.94283, NaN, NaN;
64.2, 0, 0.003010443, 0.006364009, 0.008637602, 15248.93619, NaN, NaN;
64.205, 0, 0.003010237, 0.006363596, 0.008637031, 15244.70940, NaN, NaN;
64.206, 0, 0.003010196, 0.006363514, 0.008636916, 15243.86357, NaN, NaN;
64.20625, 0, 0.003010185, 0.006363493, 0.008636888, 15243.65209, NaN, NaN;
64.2065, 0, 0.003010175, 0.006363472, 0.008636859, 15243.44060, NaN, NaN;
64.20652, 0, 0.003010174, 0.006363471, 0.008636857, 15243.42368, NaN, NaN;
64.20654, 0, 0.003010173, 0.006363469, 0.008636855, 15243.40676, NaN, NaN;
64.20655, 0, 0.003010173, 0.006363468, 0.008636853, 15243.39830, NaN, NaN;
64.20656, 0, 0.003010173, 0.006363467, 0.008636852, 15243.38984, NaN, NaN;
64.20657, 0, 0.003010172, 0.006363467, 0.008636851, 15243.38138, NaN, NaN;
64.206585, 0, 0.003010172, 0.006363465, 0.008636849, 4574.477195, 4586.732716, 15243.36869;
64.2066, 0, 0.003010171, 0.006363464, 0.008636848, 4571.531294, 4589.691307, 15243.356;
64.20685, 0, 0.003010161, 0.006363444, 0.008636819, 4551.894213, 4609.539893, 15243.1445;
64.2069, 0, 0.003010159, 0.006363439, 0.008636813, 4549.426486, 4612.049921, 15243.10219;
64.207, 0, 0.003010154, 0.006363431, 0.008636802, 4545.006711, 4616.554301, 15243.01759;
64.2085, 0, 0.003010093, 0.006363307, 0.008636630, 4505.449493, 4657.380785, 15241.74832;
64.21, 0, 0.003010031, 0.006363184, 0.008636459, 4480.741068, 4683.358828, 15240.4787;
64.22, 0, 0.003009619, 0.006362358, 0.008635316, 4385.641777, 4786.931245, 15232.00558;
64.27, 0, 0.003007561, 0.006358236, 0.008629604, 4170.120041, 5045.056665, 15189.40189;
64.3, 0, 0.003006327, 0.006355765, 0.008626181, 4088.504485, 5152.428497, 15163.64562;
64.4, 0, 0.003002222, 0.006347542, 0.008614790, 3893.505345, 5434.374264, 15076.69899;
64.6, 0, 0.002994047, 0.006331160, 0.008592097, 3639.774517, 5867.425724, 14897.37836;
64.8, 0, 0.002985915, 0.006314862, 0.008569524, 3459.483963, 6235.177491, 14709.91715;
65, 0, 0.002977828, 0.006298648, 0.008547069, 3316.083523, 6575.516551, 14512.97853;
65.5, 0, 0.002957800, 0.006258474, 0.008491443, 3044.087485, 7394.187039, 13966.30408;
66, 0, 0.002938040, 0.006218810, 0.008436536, 2841.054607, 8266.973646, 13296.55035;
66.25, 0, 0.002928259, 0.006199166, 0.008409348, 2755.517493, 8773.369346, 12875.69176;
66.5, 0, 0.002918542, 0.006179646, 0.008382335, 2677.870997, 9395.924499, 12330.7831;
66.7, 0, 0.002910815, 0.006164118, 0.008360849, 2620.511006, 10150.59905, 11633.46855;
66.75, 0, 0.002908890, 0.006160248, 0.008355494, 2606.758303, 10506.68991, 11291.13038;
66.76, 0, 0.002908505, 0.006159474, 0.008354424, 2604.034362, 10626.61266, 11173.93158;
66.765, 0, 0.002908313, 0.006159088, 0.008353889, 2602.675670, 10712.68460, 11089.21834;
66.767, 0, 0.002908236, 0.006158933, 0.008353676, 2602.132803, 10760.96710, 11041.47869;
66.7675, 0, 0.002908217, 0.006158894, 0.008353622, 2601.997140, 10775.87550, 11026.70596;
66.7676, 0, 0.002908213, 0.006158887, 0.008353611, 2601.970010, 10779.07312, 11023.53547;
66.7677, 0, 0.002908209, 0.006158879, 0.008353601, 2601.942881, 10782.35589, 11020.27983;
66.7678, 0, 0.002908205, 0.006158871, 0.008353590, 2601.915753, 10785.73105, 11016.9318;
66.76785, 0, 0.002908203, 0.006158867, 0.008353585, 2601.902190, 10787.45582, 11015.22059;
66.76787, 0, 0.002908202, 0.006158866, 0.008353582, 2601.896764, 10788.15303, 11014.52881;
66.76789, 0, 0.002908202, 0.006158864, 0.008353580, 2601.891339, 10788.85452, 11013.83274;
66.7682, 0, 0.002908190, 0.006158840, 0.008353547, 2601.807249, 10800.34357, 11002.42778;
66.7684, 0, 0.002908182, 0.006158825, 0.008353526, 2601.753003, 10808.50111, 10994.32449;
66.7686, 0, 0.002908174, 0.006158809, 0.008353504, 2601.698759, 10817.44178, 10985.43807;
66.7687, 0, 0.002908171, 0.006158802, 0.008353494, 2601.671639, 10822.28750, 10980.61946;
66.7688, 0, 0.002908167, 0.006158794, 0.008353483, 2601.644520, 10827.44796, 10975.48612;
66.7689, 0, 0.002908163, 0.006158786, 0.008353472, 2601.617401, 10832.99407, 10969.96713;
66.7693, 0, 0.002908147, 0.006158755, 0.008353430, 2601.508935, 10862.33282, 10940.73684;
66.76935, 0, 0.002908146, 0.006158751, 0.008353424, 2601.495378, 10867.73916, 10935.34406;
66.7694, 0, 0.002908144, 0.006158748, 0.008353419, 2601.481821, 10874.19121, 10928.90557;
66.76945, 0, 0.002908142, 0.006158744, 0.008353413, 2601.468264, 10882.73426, 10920.37607;
66.76946, 0, 0.002908141, 0.006158743, 0.008353412, 2601.465553, 10884.96167, 10918.15137;
66.76948, 0, 0.002908141, 0.006158741, 0.008353410, 2601.460130, 10890.70961, 10912.40886;
66.76949493,0, 0.002908140, 0.006158740, 0.008353409, 2601.456082, 10901.51159, 10901.61093;
66.7695, 0, 0.002908140, 0.006158740, 0.008353408, 2601.454708, NaN, NaN;
66.77, 0, 0.002908121, 0.006158701, 0.008353355, 2601.319154, NaN, NaN;
66.8, 0, 0.002906967, 0.006156383, 0.008350147, 2593.225376, NaN, NaN;
66.9, 0, 0.002903129, 0.006148667, 0.008339473, 2566.791534, NaN, NaN;
67, 0, 0.002899301, 0.006140971, 0.008328825, 2541.158078, NaN, NaN;
67.25, 0, 0.002889776, 0.006121815, 0.008302326, 2480.279779, NaN, NaN;
67.5, 0, 0.002880313, 0.006102778, 0.008275995, 2423.497401, NaN, NaN;
67.75, 0, 0.002870911, 0.006083859, 0.008249830, 2370.305736, NaN, NaN;
67.9, 0, 0.002865300, 0.006072564, 0.008234210, 2339.938821, NaN, NaN;
68, 0, 0.002861571, 0.006065057, 0.008223830, 2320.290472, NaN, NaN;
68.5, 0, 0.002843072, 0.006027799, 0.008172318, 2228.465883, NaN, NaN;
69, 0, 0.002824810, 0.005990997, 0.008121448, 2145.858870, NaN, NaN;
70, 0, 0.002788981, 0.005918724, 0.008021584, 2002.325936, NaN, NaN;
74, 0, 0.002654317, 0.005646266, 0.007645531, 1603.281128, NaN, NaN;
78, 0, 0.002532058, 0.005397790, 0.007303154, 1351.118582, NaN, NaN;
82, 0, 0.002420566, 0.005170262, 0.006990123, 1172.989017, NaN, NaN;
86, 0, 0.002318478, 0.004961141, 0.006702822, 1038.936050, NaN, NaN;
90, 0, 0.002224653, 0.004768279, 0.006438202, 933.7463955, NaN, NaN;
94, 0, 0.002138126, 0.004589851, 0.006193681, 848.6847860, NaN, NaN;
96, 0, 0.002097339, 0.004505553, 0.006078255, 811.9181125, NaN, NaN;
100, 0, 0.002020261, 0.004345917, 0.005859845, 747.4529002, NaN, NaN]
vect1=Mat1(:,6)
vect2=Mat1(:,1)
vector1=Mat1(:,6)
vector2=Mat1(:,1)
vect1(1:45)=NaN
vect2(1:45)=NaN
vector1(46:end)=NaN
vector2(46:end)=NaN
plot(Mat1(:,1),Mat1(:,2),'r')
hold on
plot(Mat1(:,1),Mat1(:,3),'k')
hold on
plot(Mat1(:,1),Mat1(:,4),'k')
hold on
plot(Mat1(:,1),Mat1(:,5),'k')
hold on
plot(vect2,vect1,'k')
hold on
plot(vector2,vector1,'k')
hold on
plot(Mat1(:,1),Mat1(:,7),'r')
hold on
plot(Mat1(:,1),Mat1(:,8),'k')

Accepted Answer

William Rose
William Rose on 14 Oct 2023

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!