Group Abstract Group Abstract

Message Boards Message Boards

Any suggestions for displaying text Grid with Overlay plot?

Posted 7 years ago
POSTED BY: diller ryan
6 Replies

diller,

First, there is a good reference for plotting with two Y axes on the Wolfram site. The function can be easily modified to do DateListPlots by changing "Plot" and removing the range list and adjusting a few parameters. Then your plot will not be an overlay and will be a bit more general. See How to | Generate Plots with Two Vertical Scales. This will not fix your second problem but it may be useful.

To fix the second problem, you need to specify the ImageSize for the plots (which will carryover to the overlay). If you do this I think you get what you want.

plot1 = DateListPlot[ts1, PlotStyle -> Red, 
   Frame -> {True, True, False, False}, ImagePadding -> 25, 
   FrameTicks -> {None, All, None, None}, 
   FrameStyle -> {{Directive[Red], None}, {None}}, ImageSize -> Large];
plot2 = DateListPlot[ts2, PlotStyle -> Blue, 
   Frame -> {False, False, False, True}, ImagePadding -> 25, 
   FrameTicks -> {{None, All}, {None, None}}, 
   FrameStyle -> {{None, Directive[Blue]}, {None}}, 
   ImageSize -> Large];
overPlot = Overlay[{plot1, plot2}]

Now you can use Row or Grid:

Row[{labeledTable, overPlot}]

To get:

enter image description here

Of course the Plot is a bit too big so you can adjust the sizes accordingly. ImageSize can also take numerical sizes. You can also specify the size of your grid. I hope this helps.

Regards,

Neil

POSTED BY: Neil Singer

Gustavo,

I agree it is not easy to find. I often use a search engine (duckduckgo) to search the mathematica documentation if I can't find it quickly using the built-in documentation search. In this case I remembered it existed so I did a web search and not a documentation search. However, I also found it relatively quickly by opening up the documentation for "Plot" and followed the links at the bottom for "Basic Plotting" tutorial and then following a link to "How To: Create Plots". This index had many useful pages including plotting with two axes. I find the documentation works well if you find a command that is close and follow the links.

I suggest reporting this issue to support and maybe they will make the searching more affective in the future.

Regards,

Neil

POSTED BY: Neil Singer

guide/HowToTopics >> howto/CreatePlots >> howto/GeneratePlotsWithTwoVerticalScales

yee not so easy to find this in the Search hit list.

maybe sometimes Browse is the way to go

POSTED BY: Raspi Rascal
POSTED BY: Jos Klaps

It is interesting that if I open the documentation browser and search for "Generate Plots with Two Vertical Scales", I don't find this guide. I wonder what I need to type to get there in Mathematica.

POSTED BY: Gustavo Delfino

I like Neil's method with ImageSize->Large . Nice!

POSTED BY: Raspi Rascal
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard