Group Abstract Group Abstract

Message Boards Message Boards

2
|
2.5K Views
|
3 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Aligning a rotated plot with a normal plot

Posted 2 years ago

Hi, I am working on a problem where an electron is subject to a well potential, so I want to be able to have one plot that shows the Energy as a function of x, and another plot beside it that shows transmission and reflection as a function of Energy. I want to line it up like one of my friends has in python (attached).

When I try to rotate a plot in Mathematica, I have had nothing but issues. The closest I have been able to get is using Graphics Row with set image sizes and aspect ratios, but the plots are not at all aligned and this cuts off the axes. I also have not been able to rotate any of the axes ticks on the rotated graph.

Any help you could give me would be much appreciated, thanks! A minimum working example notebook of my code is attached.

Attachment

Attachments:
POSTED BY: Kim Owen
3 Replies

You can put these plots together using Graphics and Inset. Ideally you want to use GraphicsRow here, but aligning these plots is a bit finicky.

This is the end result on my machine. You may need to tweak some things, but it should approximate the plot you have shown:

enter image description here

Attachments:
POSTED BY: Arnoud Buzing

For the right plot you can use ParametricPlot. See the attached notebook for my best approximation of your plot from the screen capture.

Here is a simple example to help you understand how ParametricPlot can flip the axes:

ParametricPlot[{Sin[x], x}, {x, 0, 2 \[Pi]}]
Attachments:
POSTED BY: Arnoud Buzing
Attachments:
POSTED BY: Arnoud Buzing
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard