Message Boards Message Boards

GROUPS:

Display a subplot within ListLinePlot ?

Posted 1 month ago
352 Views
|
5 Replies
|
8 Total Likes
|

Hi,

I would like to have a subplot within the following ListLinePlot.

I appreciate your help.

data = {1303.`, 1027.`, 838.8`, 1320.`, 1351.`, 1339.`, 1344.3`, 
   1309.3`, 1513.3`, 1528.3`, 1168.4`, 1165.4`, 952.8`, 1271.5`, 
   1124.5`, 1175.`, 1102.`, 1028.`, 1226.9`, 1141.3`, 1186.3`, 
   1527.4`, 1230.6`, 1196.2`, 2160.1`, 1256.7`, 1060.`, 1552.6`, 
   1474.8`, 1116.7`, 1230.5`, 1126.`, 1444.2`, 1374.7`, 1361.5`, 
   1372.1`, 1453.6`, 1124.8`, 1147.`, 1336.`, 1087.7`, 1179.4`, 
   970.9`, 1211.2`, 1296.2`, 1271.9`, 1121.8`, 1109.3`, 1595.`, 
   959.1`, 1116.1`, 1295.1`, 957.3`, 883.`, 1224.5`, 1272.1`, 1177.9`,
    1076.6`, 991.6`, 1030.7`, 796.2`, 1024.5`, 771.6`, 1268.9`, 
   1241.5`, 1030.3`, 1064.7`, 1665.1`, 1263.7`, 1408.`, 1320.9`, 
   1133.4`, 1067.`, 1657.4`, 1360.4`, 1177.`, 1017.4`, 765.30`, 
   1018.40`, 1096.39`, 1408.60`, 1392.99, 1128.89, 1269.};

p = ListLinePlot[data];

Show[p, Epilog -> Inset[p, {20, 30}, Automatic, 15], {Automatic, 
  Automatic}]
5 Replies
Posted 1 month ago
Show[p, Epilog -> {Inset[p, {30, 1500}, {Automatic, Automatic}, 50]}]

Coordinate (30,1500) is where you position the subplot.

{Automatic, Automatic } is the opos coordinates, I don't quite understand its function at the moment.

50 is the subplot size.

Posted 1 month ago

Thank you so much Ehud.

Could you please let me know, how I have a subplot for the below ranges?

enter image description here

Posted 1 month ago

Hi Alex,

You can experiment with this

p2 = ListLinePlot[data,
   PlotRange -> {{20, 30}, {1000, 1500}},
   ImageSize -> 75,
   Axes -> False,
   Frame -> True,
   FrameTicks -> None];

epilog = {
  {Inset[p2, {45, 1800}]},
  {Opacity[0], White, EdgeForm[Red], Rectangle[{20, 1000}, {30, 1500}]}}

Show[p, Epilog -> epilog]

enter image description here

Posted 1 month ago

Thank you so much, Rohit.

You always have an unbelievable solution way.

Posted 1 month ago

Hi Alex,

If your inset / multi-panel plotting requirements are more complex or you need to generate publication quality plots, you should take a look at the SciDraw package.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract