'Matplotlib - stretch different subplots to same axis on 3d graph
Suppose an array like:
[ [ [1,2,3,4,5,6,7], [10,11,12,13,14,15,16] ] , [ [1,2,3], [17,23,16] ] , [ [1,2] , [9,13] ] ]
^ So 3 different (x,y) data sets.
If I go ahead and plot all 3 using subplots, the x axis takes a range of 1 --> 7, thus the 2nd and 3rd data sets are condensed to the beginning of the chart. I'm aware of ways to stretch them out on a 2d array and thus give them their own distinct x ranges, however,
Suppose I have 2 more data sets like that I need to plot as well, and thus go ahead and use a 3d graph from plt.axes(projection='3d'). These other 2 data sets have the same x ranges (1-->7), but again, have different y ranges.
How do I stretch all three data sets on the 3d graph to their own distinct x ranges.
i.e.
fig = plt.figure() ax = plt.axes(projection='3d')
ax.plot([1,2,3,4,5,6,7] , [10,11,12,13,14,15,16], 0), ax.plot([1,2,3], [17,23,16], 0), ax.plot([1,2], [9,13], 0)
ax.plot([1,2,3,4,5,6,7], [4,5,1,4,5,6,7], 1), ax.plot([1,2,3], [9,8,2], 1), ax.plot([1,2], [12,18], 1 )
ax.plot([1,2,3,4,5,6,7], [6,5,4,3,2,1,6], 2 ), ax.plot([1,2,3], [12,4,9], 2 ), ax.plot([1,2], [1,3], 2 )
should display 3 distinct 2d graphs on seperate z values (bold number), but be stretched out to use their distinct x axes
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
