SPSite spsite1=new SPSite(SPContext.Current.Web.Url); will give you SPSite object. But it will be site collection object only when SPContext.Current.Web.Url is that of root web. If the web object is that of a sub site then SPSite object won't be a site collection object. The second statement SPSite spsite2=new SPSite(SPContext.Current.Site); is wrong because there is no overload of SPSite which has SPSite as parameter.   

UPDATE

If the intention is to get the rootweb then second is a better way of doing it as you are not instantiating a new SPSite object. Moreover, in the first case you will need to dispose SPSite object as you are creating a new one compared to second in which SPSite is retrieved through SPContext which should not be disposed explicitly.

What is difference between SPContext.Current.Web.URL and SPContext.Current.Site when using SPSite object?
I am making some density and contour plots in Mathematica. These plots have very high peaks which saturate with color and prevent me from seeing differences in the peaks. Is there a way I can tone down the color scale so my peaks are not just white blobs?

Trying other color schemes has not worked out, and playing with the range of color data has not been very useful. Is there some way to have the colors on a log scale???

Here is my code.

ListDensityPlot[photo, PlotLegends -&gt; Automatic, Frame -&gt; {True}, 
FrameLabel -&gt; {"Electron Bunch Energy (MeV)", "Photon Energy (keV)", 
"", "Yield (Photons/Sr e-KeV)" }, LabelStyle -&gt; {15}, 
InterpolationOrder -&gt; 10]




Cheers, Ben
