Timeline for How can I fix an Inset plot to the top right corner of the main plot?
Current License: CC BY-SA 4.0
18 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 6, 2019 at 16:56 | history | edited | m_goldberg | edited tags | |
| Dec 6, 2019 at 16:50 | answer | added | m_goldberg | timeline score: 1 | |
| Dec 6, 2019 at 16:25 | review | Close votes | |||
| Dec 10, 2019 at 9:01 | |||||
| Dec 6, 2019 at 16:15 | answer | added | Carl Woll | timeline score: 3 | |
| Dec 6, 2019 at 13:09 | comment | added | b.gates.you.know.what | @camileri Please try adjusting the PlotRange of the inset or adding some Padding. | |
| Dec 6, 2019 at 11:21 | comment | added | camileri | While this works perfectly for the Plot[Sin[x]] - example, it still cuts off the very top right off the plot for my ListPlots. The last data point is not shown and the y axis-labels are sometimes cut off at the top. I don't know how to upload the screenshot I've made to make this more clear though. If you happen to know a way to just move it very slightly towards the bottom left, that would be great! | |
| Dec 6, 2019 at 11:00 | comment | added | camileri | Oh yes! I missed that you added a third argument to the Inset! This works perfectly in the example and I hope that it will work for all of my other plots as well. Thank you so much! | |
| Dec 6, 2019 at 10:58 | comment | added | b.gates.you.know.what | @camileri I get that the {Right, Top} (3rd argument) corner of the inset is placed at the {Right, Top} (2nd argument) corner of the main plot so the inset is fully visible. | |
| Dec 6, 2019 at 10:51 | comment | added | camileri | This almost works. However, it moves the plot so far to the top right that it I can only see the bottom left quarter of the Inset-plot. It appears that the middle of the plot is at the top right corner of the main plot and everything outside is cut off. | |
| Dec 6, 2019 at 10:41 | comment | added | b.gates.you.know.what | Maybe Plot[Sin[x], {x, 0, 2 \[Pi]}, Epilog -> Inset[p2, {Right, Top}, {Right, Top}], ImageSize -> Large] ? | |
| Dec 6, 2019 at 10:39 | comment | added | camileri | Doesn't this still require knowledge of my data, because I choose the PlotRange manually? If I do not know what y-values to expect, how do I transfer this? | |
| Dec 6, 2019 at 10:35 | history | edited | camileri | CC BY-SA 4.0 | added 354 characters in body |
| Dec 6, 2019 at 10:31 | comment | added | Lotus | You can use Scaled in spacifying the inset plot's co-ordinates. For example compare: Plot[Sin[x], {x, 0, 10}, Epilog -> Inset[Plot[Cos[x], {x, -1, 1}], Scaled[{0.7, 0.7}]], PlotRange -> {{0, 10}, {-1, 3}}] and Plot[Sin[x], {x, 0, 100}, Epilog -> Inset[Plot[Cos[x], {x, -1, 1}], Scaled[{0.7, 0.7}]], PlotRange -> {{0, 100}, {-1, 3}}] | |
| Dec 6, 2019 at 10:30 | history | edited | camileri | CC BY-SA 4.0 | added 944 characters in body |
| Dec 6, 2019 at 10:27 | comment | added | camileri | Yes, of course: | |
| Dec 6, 2019 at 10:22 | comment | added | Yves Klett | Welcome! Could you please add code for different (small) sample plots to clarify what you want to achieve? Adding code is usually extremely helpful for formulating answers. | |
| Dec 6, 2019 at 10:15 | review | First posts | |||
| Dec 6, 2019 at 13:21 | |||||
| Dec 6, 2019 at 10:13 | history | asked | camileri | CC BY-SA 4.0 |