Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to make two plots on a different scale

I have two plots that I need to represent on the same graph. Here is a mwe. I can scale q2 down, but ideally I would like to have a y-axis on the left representing q1 values and another y-axis on the right representing q2 values. How can I do that?

phi = var('phi')
a=2
q1=a*phi^2+1
q2=a*phi^2+2000
t1=q1.plot(aspect_ratio=1,xmin=0,xmax=10)
t2=q2.plot(aspect_ratio=1,xmin=0,xmax=10)
z=t1+t2
z.show(xmin=0,xmax=10,ymin=0,ymax=300,aspect_ratio=.02)