Colorbar for Matplotlib 3D patch plot
Coding style

There is an official coding style guide for Python called PEP8. Give it a good read and follow it. For example, the most glaring violations:


Spacing around operators: instead of v=v+j[2], write as v = v + j[2]
For function names, snake_case is preferred over camelCase
Put exactly two blank lines before each function definition


Coding practices

Don't put code in the global namespace, put inside a function.
This protects you from bad practices like using global variables, whether intentionally or by accident.

For example, you could move all the code current code in the global namespace inside a main function:

def main():
    fig = plt.figure()
    ax = plt.axes(projection='3d')
    P = [(0, 0, 0), (2, 0, 0), (2, 2, 0), (0, 2, 0), (0, 2, 2), (2, 2, 2), (0, 0, 2)]
    F = [[0, 1, 2, 3], [2, 3, 4, 5], [0, 3, 4, 6]]
    # ...


And call the main function like this:

if __name__ == '__main__':
    main()


Avoid unused imports:

import numpy as np


Naming

The biggest issue with this code is the naming of variables.
You're overusing single-letter or very short variable names,
and it's hard to guess what is what without searching for where they come from and how they are used.

Simplify

You have many expressions that can be simplified, for example:

# instead of: v = v + j[2]
v += j[2]

# instead of: v = v / 4.
v /= 4.