2
$\begingroup$

I have a set of data points and I used ListPlot to plot the result, now I want to add some graphics in order to show its relevance with observational data. I want to add some colored region and lines in order to show the range of the observational data. It is showing an error of ListLogLinearPlot: Options expected (instead of -------) beyond position 1 etc

data2 = Import["C:\\Users\\Name\\Documents\\File\\Plot.xlsx"]
{{{1., 0.00145571}, {2., 0.000512172}, {3., 0.000413558}, {4., 
0.000327206}, {5., 0.000232578}, {6., 0.000222551}, {7., 
0.00021316}, {8., 0.000170132}, {9., 0.000154532}, {10., 
0.000144734}, {11., 0.000142964}, {12., 0.000142123}, {13., 
0.00015819}, {14., 0.000151158}, {15., 0.00014666}, {16., 
0.000156776}, {17., 0.000169387}, {18., 0.000171444}, {19., 
0.000178187}, {20., 0.000205979}, {21., 0.000236261}, {22., 
0.000277336}, {23., 0.000318483}, {24., 0.000306874}, {25., 
0.000305332}, {26., 0.000304559}, {27., 0.00031249}, {28., 
0.00034653}, {29., 0.000357357}, {30., 0.000361888}, {31., 
0.000366362}, {32., 0.000364678}, {33., 0.000351303}, {34., 
0.000383127}, {35., 0.000665384}, {36., 0.000731365}, {37., 
0.000802051}, {38., 0.000822485}, {39., 0.000848101}, {40., 
0.000868197}, {41., 0.000950965}, {42., 0.00105685}, {43., 
0.00118864}, {44., 0.00121142}, {45., 0.00120132}, {46., 
0.00121224}, {47., 0.00119165}, {48., 0.00122794}, {49., 
0.00130161}, {50., 0.00133704}}}

ListLogLinearPlot[data2, AxesLabel -> {Q, r}, LabelStyle -> {Black, 13}, PlotStyle -> Blue, 
PlotRange -> {Full, {0, 0.14}}, PlotMarkers -> {Automatic, Medium}, Graphics[{EdgeForm[Thin], Transparent, Rectangle[{5, 0}, {30, 0.12}]}],
Epilog -> {Thick, Black, Dashed, Line[{{1, 0.12}, {50, 0.12}}]}]

Image

$\endgroup$
17
  • $\begingroup$ Look up Show. You can't simply put your Graphics statement inside the arguments of a plotting command. $\endgroup$
    – LLlAMnYP
    Jun 19, 2017 at 4:42
  • $\begingroup$ You have an evident problem between PlotMarkers and Epilog. The Graphics can be inserted in plotter just as part of Epilog or Prolog. Or you should use the separate layer of Graphics and combine it with ListLogLinearPlot using Show. $\endgroup$
    – Rom38
    Jun 19, 2017 at 4:47
  • $\begingroup$ @Rom38 Is this the right thing? p2 = ListLogLinearPlot[data2, AxesLabel -> {Q, r}, LabelStyle -> {Black, 13}, PlotStyle -> Blue, PlotRange -> {Full, {0, 0.14}}, PlotMarkers -> {Automatic, Medium}, Epilog -> {Thick, Black, Dashed, Line[{{1, 0}, {30, 0.12}}]}] Show[p2, Graphics[{EdgeForm[Thin], Transparent, Rectangle[{5, 0}, {30, 0.12}]}]] $\endgroup$
    – mathemania
    Jun 19, 2017 at 7:34
  • $\begingroup$ Looks correct. If this works, I think the question can be closed. $\endgroup$
    – LLlAMnYP
    Jun 19, 2017 at 7:51
  • $\begingroup$ @LLlAMnYP I have added the plot above, it doesn't look right. There is no rectanglular region behind and the dashed line is not horizontal and not in the correct position, it should be on the $r=0.12$ line. $\endgroup$
    – mathemania
    Jun 19, 2017 at 7:58

0

Browse other questions tagged or ask your own question.