DG0 functions are plotted with reversed axes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
New
|
Undecided
|
Unassigned |
Bug Description
Dear Dolfin developpers,
I think I have found a behaviour that looks like a bug to me.
I was trying to import data from a tiff image to a DG0 function. I was struggling to get the axes' orientation in agreement with he rest of my functions, when I realized that plotting a DG0 function produces a plot with its reversed compared to the same function projected on a CG1 space... Both x and y axis are reversed. I don't know about z, since I look at 2D data.
Here is a little piece of code, to be run with the attached image. Am I doing something wrong ? Isn't the DG0 image reversed ?
Thanks in advance for your help.
(This is on Dolfin 1.1.0 compiled with Dorsal on MacOS X 10.6.8)
import numpy
import dolfin
import Image
#input filename
file_im = 'image.png'
# input image
IM = Image.open(file_im)
# convert to numpy array
im = numpy.array(
# image size
Ly = 1e0
Lx = Ly*IM.size[
Ny, Nx = im.shape
# create mesh
mesh = dolfin.
# load numpy array in DG0 image
V_DG0 = dolfin.
I_DG0 = dolfin.
I_DG0.vector()[:] = im[::-1,
# project on CG1
V_CG1 = dolfin.
I_CG1 = dolfin.
# plot => axes are reversed
dolfin.plot(I_DG0, title="DG0", axes=True)
dolfin.plot(I_CG1, title="CG1", axes=True)
dolfin.