I want to make a plot in which unit interval on both axes to have equal lengths visually. i.e. I want (1,1) and (0,0) to make a square rather than an elongated rectangle.
I could not find the option to make it possible for the following simple case:
ListLinePlot[{{{0, 0}, {1, -1}, {2, -2}, {3, -1}, {4, -2}, {5, -3}, {6, -4}, {7,
-3}, {8, -2}, {9, -1}}}]
Thank you for your help.
Edit
More generally, how to adjust the ratio of the unit interval on x-axis to that on y-axis? AspectRatio
option does not seem to directly correlate with it.
You want: AspectRatio -> Automatic
.
Example of the requested generalization:
p = Plot[Sin[x], {x, 0, 10}];
range = First /@ Differences /@ (PlotRange /. Options[p]);
target = 1/2;(* 1 y == 2 x *)
Show[p,
AspectRatio -> (Last[range]/First[range]/target)]
(Plot
by default will include an explicit plot range, so we can use Options
, as long as we don't set something like PlotRange->All
.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With