A suggestion: when you insert code, it looks much better if you use mark-up. In-line code is typeset by enclosing it with single back-tic. Displayed code should be enclosed in triple back-tics, and the first triple back-tic allows to specify the language in case you want syntax high-lighting.
The following code uses Plots and pyplot as back-end:
using Plots; pyplot();
xc = [0,0,1,1]
yc = [0,1,1,0]
zc = [1,1,2,2];
plot(xc,yc,zc,st=:surface,camera=(-30,30))
The result is as follows:
A few comments:
- In your first case, you use raw
PyPlot. An alternative is to usepyplotas a back-end to thePlotsAPI – as I’ve done. - In your case of using
Plots, you use theplotlyjsback-end. I used thepyplotback-end. There is also agrback-end, etc. Thegrback-end is the default forPlots. In my view,grgives the purest/prettiest lines, etc. However,pyplotseems to have slightly better support of thePlotsAPI, and also has the best \LaTeX support. - Your plot using
plotlyjsback-end doesn’t really show any plot in my browser. I don’t know why; in any way, I usepyplotas back-end toPlots. - You import
Plotsusing statementimport Plots. That is fine; if you do so, you need to use the package name when issuing the command, i.e.,Plots.plot. I importPlotsby statementusing Plots– the advantage is that then you don’t need to specify the package name. Such import is less “dangerous” in Julia than in, say, Python, because of Julia’s multiple dispatch idea. - Observe that I used the
cameraoption inplot– sometimes it is necessary to do this to rotate the coordinate system to get a good view of the object. - Finally, I prefer to use comma (“,”) to separate vector elements; you have used semicolon (“;”). This is not a big thing here.
