Plotting with matplotlib looks blocky in notebook
Issue #765
resolved
At the moment, the behaviour of plot is like this:
mesh = UnitSquareMesh(4,4)
Q = FunctionSpace(mesh, "CG", 1)
F = Function(Q)
F.interpolate(Expression("cos(x[0])*sin(x[1])", degree=1))
plot(F)
or
plot(F, shading='gouraud')
or
plot(F, mode='contour')
I suggest changing the default to use plt.tricontourf()
, with, say, 40 contour levels, to get:
Comments (10)
-
-
reporter I think it gets passed through with the
**kwargs
aslevels
-
reporter It is an easy fix. I can push it today.
-
I remind that me or Chris talked to matplotlib developer Jens Nielsen asking for linear shading of triangulations for, I think,
tripcolor
, which would be optimal for plotting P1 functions. But the result was not very helpful as I remember. -
X3DOM is probably the way to go for contour plots.
-
reporter Well, I've pushed a branch. See what you think. I think it is better.
-
I think we can merge this.
-
- changed milestone to 2016.2
-
reporter I've got a branch for this - it can be merged now.
-
- changed status to resolved
Fixed in def1637.
- Log in to comment
Agree, but let's target the 2016.2 release.
Do we have an option for the number of levels?