1
$\begingroup$

I have a problem, the legend is shown in rotate form and I want it in normal form

Plotf = 
  Labeled[
    Rotate[Show[R5, e2, PlotRange -> All], 270 Degree ], 
    {"Depth m",  "Residual load kN"}, 
    {Left, Top}, 
    RotateLabel -> True]

Show[Plotf, 
  Epilog -> 
    Inset[
      Framed[
        Column[
          {PointLegend[{Blue}, {"   Measured"}], 
           LineLegend[{Red}, {"Estimated"}]}], 
        RoundingRadius -> 5], 
      Scaled[{0.8, 0.85}]]]
New contributor
Mohammad S Al-tawaha is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
  • 2
    $\begingroup$ What is R5 and e2? $\endgroup$ – SuTron Jan 14 at 13:48
  • $\begingroup$ Just ListPlot point dear $\endgroup$ – Mohammad S Al-tawaha Jan 14 at 15:47
0
$\begingroup$

I'm not sure I understand your question, but perhaps this example will give some idea on how to proceed.

Contrived data.

With[{n = 20},
 SeedRandom[42];
 p1 = ListLinePlot[RandomInteger[100, n], PlotStyle -> Red];
 p2 = ListPlot[RandomInteger[100, n], PlotStyle -> Blue];]

Plot

Legended[
  Labeled[
    Rotate[Show[p1, p2, PlotRange -> All], 270 Degree], 
    {"Depth m", "Residual load kN"},
    {Left, Top},
    RotateLabel -> True],
  Column[
    {PointLegend[{Blue}, {"   Measured"}], 
     LineLegend[{Red}, {"Estimated"}]}]]

plot

$\endgroup$
  • $\begingroup$ Thank you so much, it's really done well $\endgroup$ – Mohammad S Al-tawaha 2 days ago
  • $\begingroup$ @MohammadSAl-tawaha. I'm glad you find my answer useful. Please consider accepting it. You can do that by clicking on the check mark that appears on the left of the answer below the down arrow. $\endgroup$ – m_goldberg yesterday
0
$\begingroup$

You can use Legended instead of Show:

SeedRandom[1]
data1 = MapIndexed[{#2[[1]], #} &, RandomInteger[10, 25]];
data2 = MapIndexed[{#2[[1]], #} &, RandomInteger[10, 25]];
R5 = ListPlot[data1, PlotStyle -> Blue];  
e2 = ListPlot[ data2, Joined -> True, PlotStyle -> Red];
Plotf = Labeled[Rotate[Show[R5, e2, PlotRange -> All], 
   270 Degree], {"Depth m", "Residual load kN"}, {Left, Top}, RotateLabel -> True];

Legended[Plotf, Placed[Framed[Column[{PointLegend[{Blue}, {"   Measured"}], 
     LineLegend[{Red}, {"Estimated"}]}], RoundingRadius -> 5], Scaled[{0.8, 0.85}]]]

enter image description here

If the input data for the two plots are lists of pairs like data1 and data2 above, you can get the same result with a single ListPlot with the options ScalingFunctions, Frame and FrameLabels without having to use rotation:

ListPlot[{Reverse /@ data1, Reverse /@ data2}, 
 PlotStyle -> {Blue, Red}, 
 ScalingFunctions -> {None, "Reverse"}, 
 Joined -> {False, True}, 
 PlotLegends -> Placed[Framed[Column[{PointLegend[{Blue}, {"   Measured"}], 
      LineLegend[{Red}, {"Estimated"}]}], RoundingRadius -> 5], Scaled[{0.8, 0.85}]], 
 Frame -> {{True, False}, {False, True}}, 
 FrameTicks -> All,
 FrameLabel -> {{"Depth m", None}, {None, "Residual load kN"}}, 
 AspectRatio -> 1]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you so much Dear $\endgroup$ – Mohammad S Al-tawaha 2 days ago
  • $\begingroup$ Dear brother, if one of this data is the result of a parametric plot will it work Thanks again for your helping $\endgroup$ – Mohammad S Al-tawaha 2 days ago
  • $\begingroup$ @MohammadSAl-tawaha, if your Plotf gives the desired result, the first approach should work. $\endgroup$ – kglr 2 days ago

Your Answer

Mohammad S Al-tawaha is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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