1
$\begingroup$

Consider a plot as

ListLinePlot[{{10, 15, 20, 25, 30, 35, 40}, {1, 2, 3, 4, 5, 6, 7}}]

enter image description here

I want to add a border to this plot like this

enter image description here

I tried to use

ImageCompose[
 Graphics[{EdgeForm[{RGBColor[192/255, 0, 0], Thickness[0.01]}], 
   LABColor[1, 0, 0, 0], 
   Rectangle[{0, 0}, {x, y}, RoundingRadius -> 0.1]}], 
 ListLinePlot[{{10, 15, 20, 25, 30, 35, 40}, {1, 2, 3, 4, 5, 6, 7}}]]

and checked with different values of x and y. However, I am not getting the desired border.

How can I do this (without losing the resolution)?

| improve this question | | | | |
$\endgroup$
6
$\begingroup$
pic = Framed[
 ListLinePlot[{
   {10, 15, 20, 25, 30, 35, 40},
   {1, 2, 3, 4, 5, 6, 7}}],
 FrameMargins -> 20,
 FrameStyle -> {Thick, Red},
 RoundingRadius -> Scaled[.05]]

Export["/Users/roberthanlon/Downloads/pic.EPS", pic]

(* "/Users/roberthanlon/Downloads/pic.EPS" *)

enter image description here

| improve this answer | | | | |
$\endgroup$
  • $\begingroup$ How can I now save the plot along with the border? $\endgroup$ – Majis Jul 27 '18 at 19:30
  • $\begingroup$ What about naming the plot pic=Framed[...]? $\endgroup$ – Ulrich Neumann Jul 27 '18 at 21:06
  • $\begingroup$ @Majis Same as in this answer. $\endgroup$ – C. E. Jul 28 '18 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.