When Plotting (using the command Plot
), AspectRatio->Automatic
means :
The explanation of Automatic
from mathematica help file, was not easy understand for me.
I want to explain it in other way :
If
the actual length from (0,0) to (1,0) in the plot is k pixels, then
the actual length from (0,0) to (0,1) in the plot is k pixels also.
Now the question : How can I set AspectRatio, so that
If
the actual length from (0,0) to (1,0) in the plot is k pixels, then
the actual length from (0,0) to (0,1) in the plot is 2k pixels ?
**I just got a message from a user, and I voted yes
for the message since it was useful. Then my question was closed(I didn't expect that). The message was useful but I still do not know exactly how to achieve this.
Can anyone help me with a comment ?**
Note that AspectRatio->1/2
is not a correct answer.
As you see in the above screenshot,
the length of (0,0) to (0, 0.1) is much much longer than
the length of (0,0) to (0.1, 0).
Not just twice longer.
+-+-+-+-+-+-+ After some comments and answers -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
In my PC, @Michael E2's second solution (=following code) works fine. Below is a screenshot on my PC.
Plot[6 Exp[-t/10] Sin[t], {t, 0, 20}, AspectRatio -> Automatic,
ScalingFunctions -> {2 # &, #/2 &}]
@Michael E2's wrote that his second solution is not good because there is unwanted, strange logarithmic peak. But in my PC, there is no such logarithmic peak phenomenon
. I am using mathematica V12.2.
AspectRatio
works. $\endgroup$PlotRange
, and then compute theAspectRatio
to give the desired scaling. You can then impose the new aspect ratio withShow[]
. You might be able to do it withScalingFunctions
like this:Plot[x, {x, 0, 10}, AspectRatio -> Automatic, ScalingFunctions -> {2 # &, #/2 &}]
(but why does it produce logarithmically spaced ticks?) $\endgroup$