I have variables N and W which change with each run. Is it possible to do something like the following?:
pylab.title('Minimal Energy Configuration of' N 'Charges on Disc' 'W = 'W)
Create data points for x and y using numpy and num (is a variable) to calculate y and set this in title. Plot x and y data points using plot() method with red color. Set the title of the curve with variable num. To display the figure, use show() method.
PyLab is a procedural interface to the Matplotlib object-oriented plotting library. Matplotlib is the whole package; matplotlib. pyplot is a module in Matplotlib; and PyLab is a module that gets installed alongside Matplotlib. PyLab is a convenience module that bulk imports matplotlib.
The title() method in matplotlib module is used to specify title of the visualization depicted and displays the title using various attributes.
I think your talking about string interpolation like this :
pylab.title('Minimal Energy Configuration of %s Charges on Disc W = %s'%(N, W))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With