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 usepyplot
as a back-end to thePlots
API – as I’ve done. - In your case of using
Plots
, you use theplotlyjs
back-end. I used thepyplot
back-end. There is also agr
back-end, etc. Thegr
back-end is the default forPlots
. In my view,gr
gives the purest/prettiest lines, etc. However,pyplot
seems to have slightly better support of thePlots
API, and also has the best \LaTeX support. - Your plot using
plotlyjs
back-end doesn’t really show any plot in my browser. I don’t know why; in any way, I usepyplot
as back-end toPlots
. - You import
Plots
using 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 importPlots
by 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
camera
option 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.