Message Boards Message Boards


[✓] Make filling from vertical epilog line to the y axis in LogLogPlot?

Posted 9 months ago
5 Replies
2 Total Likes

Hi, I would like to ask for help on how color everything to the right of a vertical line in a LogLogPlot? From the line to the right y axis. I made the following:

LogLogPlot[x^2, {x, 0, 2 Pi}, PlotRange -> {{0.001, 5}, {10^-4, 10}}, 
 Epilog -> Line[{{Log[1], Log[10^-4]}, {Log[1], Log[10]}}], 
 Frame -> True]

I need to exclude all the area from x=1 and to the right, and therefore shade it. I tried with filling but it did not produce anything, and I also tried to make a rectangle using graphics rectangle, but it can not show together with my LogLogPlot.

Thank you in advance,


5 Replies

Something like this? Fig 1


LogLogPlot[x^2, {x, 0, 2 Pi}, PlotRange -> {{0.001, 5}, {10^-4, 10}}, 
 Epilog -> {Gray, Opacity[.5], 
   Table[Line[{{Log[x0], Log[10^-4]}, {Log[x0], Log[10]}}], {x0, 1, 
     2*Pi, .01}]}, Frame -> True]
Posted 9 months ago

Thank you so much! That makes sense and works perfectly!

Thank you!

Posted 9 months ago
LogLogPlot[x^2, {x, 0, 2 Pi}, 
 Prolog -> {LightGray, 
   Rectangle[{Log[1], Log[10^-4]}, {Log[5], Log[10]}]}, Frame -> True,
  PlotRange -> {{0.001, 5}, {10^-4, 10}}]

This is a simple solution with Rectangle.

enter image description here

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract