2
$\begingroup$

After completing my PhD, I am curiously looking at the stock market from outside for now. I have some plots created to look at the market. For simplicity, let's say

stocks = {"NASDAQ:MSFT", "NASDAQ:AMZN", "NASDAQ:GOOGL"};

plot1 = ParallelMap[
   TradingChart[#, PlotLabel -> #, ImageSize -> Medium] & , stocks];

plot2 = ParallelMap[
   DateListPlot[FinancialData[#, "AdjustedClose", {2024, 4, 1}], 
     PlotLabel -> #] &, stocks];
plot3 = ParallelMap[
   DateListPlot[FinancialData[#, "AdjustedOpen", {2024, 4, 1}] , 
     PlotLabel -> #] &, stocks];
plot4 = ParallelMap[
   DateListPlot[FinancialData[#, "Volume", {2024, 4, 1}] , 
     PlotLabel -> #] &, stocks];

I have been looking at the plots as:

Grid[Partition[{plot1, plot2, plot3, plot4}, 1], 
 Frame -> {{False, False}, All}]

However, I want to show them as below for each stock. Since plot1 is tall with several indicators, I want to show other plots sideways in each row.

Grid[{{plot1, SpanFromLeft, plot2}, {SpanFromAbove, SpanFromBoth, 
   plot3}, {SpanFromAbove, SpanFromBoth, plot4}}, Frame -> All]

Thank you.

$\endgroup$

1 Answer 1

3
$\begingroup$

Not completely clear what you want, but I think you've made it too complicated:

stocks = {"NASDAQ:MSFT", "NASDAQ:AMZN", "NASDAQ:GOOGL"};

plot1 = Map[TradingChart[#, PlotLabel -> #, ImageSize -> Medium] &, 
  stocks]

plot2 = Map[
  DateListPlot[FinancialData[#, "AdjustedClose", {2024, 4, 1}], 
    PlotLabel -> #] &, stocks]
plot3 = Map[
  DateListPlot[FinancialData[#, "AdjustedOpen", {2024, 4, 1}], 
    PlotLabel -> #] &, stocks]
plot4 = Map[
  DateListPlot[FinancialData[#, "Volume", {2024, 4, 1}], 
    PlotLabel -> #] &, stocks]

Grid[{plot1, plot2, plot3, plot4}, Frame -> All]

Which gives you:

enter image description here

Or perhaps this:

Grid[{
  {plot1[[1]], plot2[[1]], plot3[[1]], plot4[[1]]},
  {plot1[[2]], plot2[[2]], plot3[[2]], plot4[[2]]},
  {plot1[[3]], plot2[[3]], plot3[[3]], plot4[[3]]}}, Frame -> All]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you @Jagra. The second row-wise version is what I was looking. I have several stocks and many plots and looking at column wise was getting out of hand. $\endgroup$
    – nsap
    Commented May 3 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.