You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to have similar hack as twinx() to have secondary x-axis on top of the plot? This can be useful when displaying the same curve with alternative units. See below for example. Or, any suggestion to achieve the same in Julia Plots? Thanks!
My minimal example code with PyPlot package (but I'd very much love to continue using Plots):
fig, ax1 = PyPlot.subplots(num="Temperature Dependence",figsize=(10,6),facecolor="0.98")
ax1.set_xlabel("Temperature (°C)", fontsize=20)
ax1.set_ylabel("Response", fontsize =20)
x =collect(0:0.1:100)
y =0.1.* x .^2-5.* x .+8
ax1.plot(x, y, lw=1., label="Object 1")
ax1.legend(loc="best")
ax1.grid(true)
ax2 = ax1.twiny()
ax2.set_xlabel("Temperature (°F)", fontsize =20)
ax2.plot(x .*9/5.+32, y, lw=0.) # Ghost plot to show scale
PyPlot.show()
The text was updated successfully, but these errors were encountered:
Is it possible to have similar hack as twinx() to have secondary x-axis on top of the plot? This can be useful when displaying the same curve with alternative units. See below for example. Or, any suggestion to achieve the same in Julia Plots? Thanks!
My minimal example code with PyPlot package (but I'd very much love to continue using Plots):
The text was updated successfully, but these errors were encountered: