I am plotting n spectrum using:
FileNameSetter[Dynamic[xx]]
v = Table[Flatten[Import[ xx[[i]] ], 1], {i, 1, Length[xx]}];
ListLinePlot[Table[v[[jj]], {jj, 1, Length[v]}],
PlotRange -> Full, AxesOrigin -> {0, 0}, PlotStyle -> Thick]
where v[[jj]]
represens the data that I am plotting.
The problem with that approach is if v[[1, x]] < v[[jj, x]]
, I cannot view the first spectrum.
Below is part of the result that I got. It has two graphics, but it is almost impossible to see the blue one.
I would like to overlay all the graphics in such a way that I can see all, like showed in this post, but in an easier way, since I cannot understand viewport
and all that.
Is there a simpler way to do this?
Edit
Here is an example of data: Spectrum1 Spectrum2
I did some modifications in the code, so now it is more general:
FileNameSetter[Dynamic[xx]]
v = Table[Flatten[Import[ xx[[i]] ], 1], {i, 1, Length[xx]}];
ww = {};
color = {Blue, Red, Green, Black, White, Gray, Cyan, Magenta, Yellow, Brown, Orange, Pink, Purple};
With[{opt =
Sequence[PlotRange -> {{500, 3000}, {0.9, 10000000}},
ImagePadding -> 35, ImageSize -> 1000,
BaseStyle -> {18, Bold}]},
For[jk = 1, jk <= Length[v], jk++,
If[jk != 1,
ww = Join[
ww, {ListLogPlot[v[[jk, 1000 ;;]], PlotStyle -> color[[jk]], Frame -> {{1, 0}, {1, 0}}, Joined -> True, opt]}],
ww = Join[ww, {ListLogPlot[v[[jk, 1000 ;;]], PlotStyle -> color[[jk]], Frame -> {{1, 0}, {1, 0}}, Joined -> True, opt]}]
];
];
Overlay[ww]
]
An advantage is that I can overlap 11 graphics together with the same scale (I put the scale but hand, but in principle it is easy to modify that).
I have still two problems:
- I can't label the axes;
- I can't put a legend without loosing the same scale for all graphics.
Any suggestions?
ImageSize/AspectRatio
,ImagePadding
and useOverlay
. Please let us know if you get stuck. Also, it is good to include the code you are working on, or at least minimal example of data. $\endgroup$Overlay
without success. It does the same asShow
. I did not understand why to useImageSize/AspectRatio
,ImagePadding
, it did nothing when I tried. Only withOpacity
I got some result, but not the best. $\endgroup$PlotRange
(not automatic or all) then there is no need to use Overlay. Try Show then. $\endgroup$