In your link, (patch array with inset feed), the current oscillates along the x-axis (for all patches). The E-field polarization of this array is aligned with the x-axis. Assuming that it radiates upwards, the E-plane is the XZ plane. The H-field is in Y-direction, hence H-plane is the YZ plane.
So if you want to draw the E-plane pattern, you need to set phi=0 and you plot gain versus theta angle. For the H-plane pattern, you set phi=90 and you plot gain versus theta angle.
It seems that the transmission line length between opposite patches is different, very likely this is to get in phase currents in all patches, may be in combination with some detuning of patches to get the required phase (but this is not related to your question).
the E plane is that plane that has the propagation direction (that is a vector) AND E-field vector in common.
For the dipole, the maximum radiation is in the XY-plane (that is theta = 90, phi = 0...360). Of course it also radiates at positive and negative elevation, but with less intensity. There are propagation vectors that leave from the origin and go to all directions in the XY plane, so the E-plane can be XZ, YZ, or any other plane that has the Z-axis in common.
If you want to plot the H-plane gain, you set theta=90 and phi goes from 0...360. You know you find something around 2.1 dB for all phi).
For antennas that have their main beam gain not on the x, y, or z axis, you can just follow the rule that the E-plane has the propagation direction and the E-field vector in common. The H-plane rotates 90 degrees around the propagation direction.