1

How to put label "Iterations" below x-axis? Possibly in an easy way without multiple commands.

a = {1, 3, 6, 3, 2};
b = {3, 2, 5, 6, 9};
c = {2, 7, 3, 1, 6};
d = {4, 2, 8, 8, 10};
am = {Position[a, Max[a]][[1, 1]], Max[a]}
bm = {Position[b, Max[b]][[1, 1]], Max[b]}
cm = {Position[c, Max[c]][[1, 1]], Max[c]}
dm = {Position[d, Max[d]][[1, 1]], Max[d]}
ListLinePlot[{a, b, c, d}, AxesLabel -> {"Iteraciones", "Objetivo"}, 
 PlotStyle -> {{Thickness[0.01], Orange}, {Dashed, 
    Thickness[0.01]}, {Thickness[0.01], Dashed, Red}}, 
 Epilog -> {PointSize[0.04], Point[{am, bm, cm, dm}]}]
Öskå
  • 8,587
  • 4
  • 30
  • 49
Mika Ike
  • 3,241
  • 1
  • 23
  • 38
  • 3
    Would you be happy to use a framed plot? Then modding to Frame -> True, FrameLabel -> {"Iteraciones", "Objetivo"} does the trick already. – Yves Klett Apr 28 '14 at 08:53
  • 4
    Without Frame you can use Labeled[(*plot*),"Iteraciones", Bottom] – Kuba Apr 28 '14 at 08:54
  • @kuba SOLVED. Thank You – Mika Ike Apr 28 '14 at 09:00
  • @YvesKlett SOLVED. Thank you. – Mika Ike Apr 28 '14 at 09:01
  • 3
    When you type "label plot below" you will get a first link to: http://mathematica.stackexchange.com/q/17747/5478 so next time please try to look for the answer via search engine in top right corner first :) – Kuba Apr 28 '14 at 09:02
  • do you know what Font is the default for graphs?... to use the same in the Labeled X-axis – Mika Ike Apr 28 '14 at 09:02
  • The difference is probably with that Labels inside Graphics are in TraditionalForm. p.s. another closely related – Kuba Apr 28 '14 at 09:04
  • @kuba , I saw that post before, but It don´t help me because... what I want is modify ONLY the x-label, and CONTINUE MAINTAINING the Y-bale over the Y label. To have the minimun possible width. Finally my solution with your help is http://sensa.square7.ch/gfdgdf51.jpg The only thing I would like to add,... is use the same Font in the bottom Label as the other label and numbers-marks – Mika Ike Apr 28 '14 at 09:12
  • I think that this question may be usefull to minimize the width of a graph. – Mika Ike Apr 28 '14 at 09:15
  • Voting to close because it is a duplicate of the first question @Kuba suggested. – Yves Klett Apr 28 '14 at 09:21

2 Answers2

9

This is just a modification of Yves' answer. If you really don't want a framed look, you can expand out the option value of the Framed option to address each side individually, like this:

a = {1, 3, 6, 3, 2};
b = {3, 2, 5, 6, 9};
c = {2, 7, 3, 1, 6};
d = {4, 2, 8, 8, 10};
max = {Position[#, Max[#]][[1, 1]], Max[#]} & /@ {a, b, c, d};
ListLinePlot[{a, b, c, d}, Frame -> {{True, False}, {True, False}}, 
 PlotRangePadding -> {{0.2, 0.5}, {0, 0.5}}, 
 FrameLabel -> {Style["Iteraciones", Red, Large], 
   Style["Objetivo", Blue, Small]}, 
 PlotStyle -> {{Thickness[0.01], Orange}, {Dashed, 
    Thickness[0.01]}, {Thickness[0.01], Dashed, Red}}, 
 Epilog -> {PointSize[0.04], Point[max]}]

enter image description here

Notice that I have also added some PlotRangePadding to avoid the big dots being cut off.

Verbeia
  • 34,233
  • 9
  • 109
  • 224
5

Personally, I prefer Frame->True for most of my plots.

a = {1, 3, 6, 3, 2};
b = {3, 2, 5, 6, 9};
c = {2, 7, 3, 1, 6};
d = {4, 2, 8, 8, 10};
max = {Position[#, Max[#]][[1, 1]], Max[#]} & /@ {a, b, c, d};
ListLinePlot[{a, b, c, d}, Frame -> True, 
 FrameLabel -> {Style["Iteraciones", Red, Large], 
   Style["Objetivo", Blue, Small]}, 
 PlotStyle -> {{Thickness[0.01], Orange}, {Dashed, 
    Thickness[0.01]}, {Thickness[0.01], Dashed, Red}}, 
 Epilog -> {PointSize[0.04], Point[max]}]

Mathematica graphics

Yves Klett
  • 15,383
  • 5
  • 57
  • 124