Skip to content
Prev 355531 / 398500 Next

How to plot shades between curves?

Hi,

Thanks for the reproducible example!  (Don't forget to make your email client send text-only messages, not html, when sending to this list).

Would log scale work for you?


Capa.diss<-c(0.7261102, 0.6655960, 0.5638357,0.8585834,0.6964527,0.8434504, 0.7106749,0.5981460,0.5747585,0.7347864,0.8012803,0.6826862,0.4949845, 0.5466870,0.5417343,0.4774860,0.4814479,0.5254794,0.6236299,0.6575862,0.7047694,0.5550153,0.4499349,0.5939971,0.4138955,0.3659061,0.3126497,0.2476329,0.2503446,0.2686042,0.3036808,0.2747602,0.4221727,0.3935815,0.3942621,0.5821026,0.2251284,0.2670861,0.3580937,0.4239509,0.4010682,0.4104427,0.3666264,0.2555372,0.2995469,0.3985690,0.4304724,0.4136308,0.3525836,0.3898816,0.3517483,0.2924678,0.4807643,0.4471870,0.3694882,0.3970183,0.4827425,0.4766994,0.3391238,0.4153885,0.5502231,0.5330776,0.5867776,0.5195776,0.4882179,0.5298611,0.4626142)

Capa.diss.age<-c(2,152,302,452,602,752,902,1052,1202,1352,1502,1652,1802,1952,2102,2252,2402,2552,2702,2852,3002,3152,3302,3452,3602,3752,3902,4052,4202,4352,4502,4652,4802,4952,5102,5252,5402,5552,5702,5852,6002,6152,6302,6452,6602,6752,6902,7052,7202,7352,7502,7652,7802,7952,8102,8252,8402,8552,8702,8852,9002,9152,9302,9452,9602,9752,9902)

plot(Capa.diss,Capa.diss.age,
    ylim = c(0,10500),
    xlim = pmax(range(Capa.diss), c(0.1, 30)),
    type="l",
    log = 'x')

Note that pmax() is selecting the maximum of each element in the two input vectors - you might want something different


Cheers,
Ben
On Oct 18, 2015, at 10:15 AM, Jackson Rodrigues <jacksonmrodrigues at gmail.com> wrote:

            
Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org