Question: Multiple curves in a dual-axis plot

I would like to combine all the plots into a single figure. The curves S1, S2, and S3 represent the manufacturer’s profit as Ce​ varies, and S12, S22, and S33 represent the retailer’s profit for the same changes in Ce​. I want all of these displayed together in one plot using a dual y-axis: one axis for the manufacturer’s profit and the other for the retailer’s profit, with Ce on the x-axis. How to create such a dual-axis plot with appropriate scaling so that the differences between the curves are also clearly visible.

restart

with(Optimization); with(plots); with(Student[VectorCalculus]); with(LinearAlgebra)

``

_local(Pi)

Pi

(1)

`Π_12` := (0.1455251030e-2*Ce+.5352049476)*(0.369876310e-1-0.3638127575e-2*Ce)+(.8*(-.1671790360+1.121361872*Ce))*(0.1849381518e-1-0.1819063782e-2*Ce)-Ce*(0.1849381518e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5352049476)*(0.369876310e-1-0.3638127575e-2*Ce)+(-.1337432288+.8970894976*Ce)*(0.1849381518e-1-0.1819063782e-2*Ce)-Ce*(0.1849381518e-1-0.1819063782e-2*Ce)

(2)

`Π_22` := (0.1455251030e-2*Ce+.5356096675)*(0.355258312e-1-0.3638127575e-2*Ce)+(.8*(-.1184158360+1.121361872*Ce))*(0.1776291535e-1-0.1819063782e-2*Ce)-Ce*(0.1776291535e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5356096675)*(0.355258312e-1-0.3638127575e-2*Ce)+(-0.9473266880e-1+.8970894976*Ce)*(0.1776291535e-1-0.1819063782e-2*Ce)-Ce*(0.1776291535e-1-0.1819063782e-2*Ce)

(3)

`Π_32` := (0.1455251030e-2*Ce+.5356038465)*(0.355403838e-1-0.3638127575e-2*Ce)+(.8*(-.1179012835+1.121361872*Ce))*(0.1777019161e-1-0.1819063782e-2*Ce)-Ce*(0.1777019161e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5356038465)*(0.355403838e-1-0.3638127575e-2*Ce)+(-0.9432102680e-1+.8970894976*Ce)*(0.1777019161e-1-0.1819063782e-2*Ce)-Ce*(0.1777019161e-1-0.1819063782e-2*Ce)

(4)

S12 := plot(`Π_12`, Ce = 0 .. 0.9e-1, color = [red], labels = ["Ce", "Manufacturer Profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("W"));`]); S22 := plot(`Π_22`, Ce = 0 .. 0.9e-1, color = [green], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("D"));`]); S32 := plot(`Π_32`, Ce = 0 .. 0.9e-1, color = [blue], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("S"));`])

 

 

 

`Π_1` := (-0.60726413e-1*Ce+.6173851967)*(0.1849381518e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1849381518e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.6173851967)*(0.1849381518e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1849381518e-1-0.1819063782e-2*Ce)^2

(5)

`Π_2` := (-0.60726413e-1*Ce+.5929853242)*(0.1776291535e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1776291535e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.5929853242)*(0.1776291535e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1776291535e-1-0.1819063782e-2*Ce)^2

(6)

`Π_3` := (-0.60726413e-1*Ce+.5932282299)*(0.1777019161e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1777019161e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.5932282299)*(0.1777019161e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1777019161e-1-0.1819063782e-2*Ce)^2

(7)

S1 := plot(`Π_1`, Ce = 0 .. 0.9e-1, color = [yellow], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("W"));`]); S2 := plot(`Π_2`, Ce = 0 .. 0.9e-1, color = [black], labels = ["Ce", "Retailer  profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("D"));`]); S3 := plot(`Π_3`, Ce = 0 .. 0.9e-1, color = [grey], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("S"));`])

 

 

 

dualaxisplot(plot(`Π_22`, Ce = 0 .. 0.9e-1, color = ["red"], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("D"));`]), plot(`Π_2`, Ce = 0 .. 0.9e-1, color = ["green"], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("D"));`]), title = "fairnes cost Comparison")

 

display({S1, S12, S2, S22, S3, S32})

 
 

``

Download All_plots_Combined.mw

Please Wait...