Repository: Qiskit/qiskit

Issue:
mpl enhancements list
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues to confirm this idea does not exist. -->

### What is the expected enhancement?

- [x] I would like the default to have a color similar to the IBM Q experience. Could we set that by default and add white as optional one. 

- [x]  The initial |0> @ajavadia and I talked and think that unless the qubit has been reset/initialize that we should drop the |0>. This way a circuit can be a sub circuit. 

<img width="352" alt="image" src="https://user-images.githubusercontent.com/15731369/57202235-bf6b2080-6f70-11e9-8f29-4be66a6bd68b.png">

- [x] The q  need to be bigger  and too much whitespace between them and the start of the circuit. 

- [x] too much white space in measurements. Also measurements need to have a little z next to them. 

<img width="642" alt="image" src="https://user-images.githubusercontent.com/15731369/57202301-ca728080-6f71-11e9-992e-e6fd07cd2f35.png">

- [x]  gates like u1, u2, and u3 lets put the params in brackets  (same with rx, ry, and rz)

<img width="242" alt="image" src="https://user-images.githubusercontent.com/15731369/57203293-b6804c00-6f7c-11e9-8ba4-8b332ad724d4.png">

- [x]  id lets make capital Id 

<img width="188" alt="image" src="https://user-images.githubusercontent.com/15731369/57203306-e29bcd00-6f7c-11e9-9197-ea53bea5cbb0.png">

- [x]  control rz need to be in brackets as well

<img width="202" alt="image" src="https://user-images.githubusercontent.com/15731369/57203330-21318780-6f7d-11e9-9a11-ae37f8dc2236.png">

- [x] reset lets remove from the box 

<img width="362" alt="image" src="https://user-images.githubusercontent.com/15731369/57203349-55a54380-6f7d-11e9-8900-14107391f239.png">

- [x]  initialization can we put a |psi> over writing initialize (maybe add vector) 

<img width="286" alt="image" src="https://user-images.githubusercontent.com/15731369/57203414-e2500180-6f7d-11e9-8bd7-4cd98ca6b424.png">

- [x] unitary can we put U over writing unitary (maybe add unitary) 

![image](https://user-images.githubusercontent.com/15731369/57203509-a9645c80-6f7e-11e9-8b1a-48066f019ee1.png)

- [ ]  barrier should not go over all qubits (just the ones that have the barrier) 

<img width="186" alt="image" src="https://user-images.githubusercontent.com/15731369/57203554-15df5b80-6f7f-11e9-9840-7b7efc441764.png">

- [ ]  the swap and cnot need to be centered a little better 

<img width="218" alt="image" src="https://user-images.githubusercontent.com/15731369/57203581-622a9b80-6f7f-11e9-9dd6-46c10addfce2.png">



Discussion:
A couple of these will be fixed by #2203 
As for the barrier one, that's actually a drawing style thing (which we probably should change because it's not the first time this has been confused, see #1870 ) The grey shading doesn't show which qubits have the barrier, that's the dashed line.
Yeah I know. I think we just get rid of dash and use grey shading. 

Resolving patch:
diff --git a/qiskit/visualization/matplotlib.py b/qiskit/visualization/matplotlib.py
--- a/qiskit/visualization/matplotlib.py
+++ b/qiskit/visualization/matplotlib.py
@@ -203,11 +203,11 @@ def _custom_multiqubit_gate(self, xy, fc=None, wide=True, text=None,
         if text:
             disp_text = text
             if subtext:
-                self.ax.text(xpos, ypos + 0.15 * height, disp_text, ha='center',
+                self.ax.text(xpos, ypos + 0.5 * height, disp_text, ha='center',
                              va='center', fontsize=self._style.fs,
                              color=self._style.gt, clip_on=True,
                              zorder=PORDER_TEXT)
-                self.ax.text(xpos, ypos - 0.3 * height, subtext, ha='center',
+                self.ax.text(xpos, ypos + 0.3 * height, subtext, ha='center',
                              va='center', fontsize=self._style.sfs,
                              color=self._style.sc, clip_on=True,
                              zorder=PORDER_TEXT)
@@ -583,6 +583,20 @@ def _draw_ops(self, verbose=False):
                                      'noise', 'cswap', 'swap', 'measure'] and len(
                                          op.name) >= 4:
                     box_width = round(len(op.name) / 8)
+                    # handle params/subtext longer than op names
+                    if op.type == 'op' and hasattr(op.op, 'params'):
+                        param = self.param_parse(op.op.params, self._style.pimode)
+                        if len(param) > len(op.name):
+                            box_width = round(len(param) / 8)
+                            # If more than 4 characters min width is 2
+                            if box_width <= 1:
+                                box_width = 2
+                            if layer_width < box_width:
+                                if box_width > 2:
+                                    layer_width = box_width * 2
+                                else:
+                                    layer_width = 2
+                            continue
                     # If more than 4 characters min width is 2
                     if box_width <= 1:
                         box_width = 2
@@ -699,13 +713,23 @@ def _draw_ops(self, verbose=False):
                     else:
                         # this stop there being blank lines plotted in place of barriers
                         this_anc -= 1
+                elif op.name == 'initialize':
+                    vec = '[%s]' % param
+                    self._custom_multiqubit_gate(q_xy, wide=_iswide,
+                                                 text="|psi>",
+                                                 subtext=vec)
+                elif op.name == 'unitary':
+                    # TODO(mtreinish): Look into adding the unitary to the
+                    # subtext
+                    self._custom_multiqubit_gate(q_xy, wide=_iswide,
+                                                 text="U")
                 #
                 # draw single qubit gates
                 #
                 elif len(q_xy) == 1:
                     disp = op.name
                     if param:
-                        prm = '{}'.format(param)
+                        prm = '({})'.format(param)
                         if len(prm) < 20:
                             self._gate(q_xy[0], wide=_iswide, text=disp,
                                        subtext=prm)
@@ -840,11 +864,9 @@ def _draw_ops(self, verbose=False):
 
     @staticmethod
     def param_parse(v, pimode=False):
-
         # create an empty list to store the parameters in
         param_parts = [None] * len(v)
         for i, e in enumerate(v):
-
             if pimode:
                 try:
                     param_parts[i] = MatplotlibDrawer.format_pi(e)
@@ -884,6 +906,10 @@ def format_pi(val):
 
     @staticmethod
     def format_numeric(val, tol=1e-5):
+        if isinstance(val, complex):
+            return str(val)
+        elif complex(val).imag != 0:
+            val = complex(val)
         abs_val = abs(val)
         if math.isclose(abs_val, 0.0, abs_tol=1e-100):
             return '0'
diff --git a/qiskit/visualization/qcstyle.py b/qiskit/visualization/qcstyle.py
--- a/qiskit/visualization/qcstyle.py
+++ b/qiskit/visualization/qcstyle.py
@@ -33,7 +33,7 @@ def __init__(self):
         self.fs = 13
         self.sfs = 8
         self.disptex = {
-            'id': 'id',
+            'id': 'Id',
             'u0': 'U_0',
             'u1': 'U_1',
             'u2': 'U_2',
@@ -123,7 +123,7 @@ def __init__(self):
         self.fs = 13
         self.sfs = 8
         self.disptex = {
-            'id': 'id',
+            'id': 'Id',
             'u0': 'U_0',
             'u1': 'U_1',
             'u2': 'U_2',


Test patch: