Generic routines for figure generation.
Class Usage Undocumented
Function enum Undocumented
Function save_figure Save figure into an image file.
Function add_image Undocumented
Function add_link Undocumented
Function save_index_html_file Undocumented
Function save_folder_index_file Undocumented
Function get_home_link Undocumented
Function get_convergence_link Undocumented
Function get_rld_link Undocumented
Function get_parent_link Undocumented
Function save_single_functions_html Undocumented
Function write_dimension_links Undocumented
Function write_tables Undocumented
Function copy_js_files Copies js files to output directory.
Function discretize_limits return new limits with discrete values in k * 10**i with k in [1, 3].
Function marker_positions return randomized marker positions
Function plotUnifLogXMarkers Proxy plot function: markers are evenly spaced on the log x-scale
Function consecutiveNumbers Groups a sequence of integers into ranges of consecutive numbers. If the prefix is set then the it's placed before each number.
Function groupByRange Groups a sequence of integers into ranges of consecutive numbers.
Function logxticks Modify log-scale figure xticks from 10^i to i for values with the limits and (re-)sets the current xlim() thereby turning autoscale off (if it was on).
Function beautify deprecated method - not used anywhere Customize a figure by adding a legend, axis label, etc.
Function generateData Returns an array of results to be plotted.
Function plot From a DataSetList, plot a graph. Not in use and superseeded by ppfigdim.main!?
Function get_first_html_file Undocumented
Function get_sorted_html_files Undocumented
Class PlottingStyle Undocumented
Function get_plotting_styles Undocumented
Function getFontSize Undocumented
def enum(*sequential, **named):
Undocumented
def save_figure(filename, algorithm=None, format=None, layout_rect=(0, 0, 0.99, 1), bbox_inches=None, subplots_adjust=None):

Save figure into an image file.

format is a str denoting a file type known to pylab.savefig, like "svg", or None in which case the defaults from genericsettings are applied.

If layout_rect, the pylab.tight_layout method is invoked with matplotlib version < 3.

subplots_adjust contains keyword arguments to call the matplotlib function with the same name with matplotlib version >= 3. The function grants relative additional space of size bottom, left, 1 - top, and 1 - right by shrinking the printed axes. It is used to prevent outside text being cut away.

'tight' bbox_inches lead possibly to (slightly) different figure sizes in each case, which is undesirable.

def add_image(image_name, add_link_to_image, height=160):
Undocumented
def add_link(current_dir, folder, file_name, label, indent='', ignore_file_exists=False, dimension=None):
Undocumented
def save_index_html_file(filename):
Undocumented
def save_folder_index_file(filename, image_file_extension):
Undocumented
def get_home_link():
Undocumented
def get_convergence_link(current_dir):
Undocumented
def get_rld_link(current_dir):
Undocumented
def get_parent_link(html_page, parent_file_name):
Undocumented
def save_single_functions_html(filename, algname='', extension='svg', add_to_names='', dimensions=None, htmlPage=HtmlPage.NON_SPECIFIED, function_groups=None, parentFileName=None, header=None, caption=None):
Undocumented
def write_dimension_links(dimension, dimensions, index):
Undocumented
def write_tables(f, caption_string_format, best_alg_exists, html_key, legend_key, dimensions):
Undocumented
def copy_js_files(output_dir):
Copies js files to output directory.
def discretize_limits(limits, smaller_steps_limit=3.1):

return new limits with discrete values in k * 10**i with k in [1, 3].

limits has len 2 and the new lower limit is always 10**-0.2.

if limits[1] / limits[0] < 10**smaller_steps_limits, k == 3 is an additional choice.

def marker_positions(xdata, ydata, nbperdecade, maxnb, ax_limits=None, y_transformation=None, xmin=1.1):

return randomized marker positions

replacement for downsample, could be improved by becoming independent of axis limits?

def plotUnifLogXMarkers(x, y, nbperdecade, logscale=False, **kwargs):

Proxy plot function: markers are evenly spaced on the log x-scale

Remark/TODO: should be called plot_with_unif_markers!? Here is where the ECDF plot "done in pprldmany" actually happens.

This method generates plots with markers regularly spaced on the x-scale whereas the matplotlib.pyplot.plot function will put markers on data points.

This method outputs a list of three lines.Line2D objects: the first with the line style, the second for the markers and the last for the label.

This function only works with monotonous graph.

def consecutiveNumbers(data, prefix=''):
Groups a sequence of integers into ranges of consecutive numbers.
If the prefix is set then the it's placed before each number.

Example::
  >>> import os
  >>> import cocopp
  >>> returnpath = os.getcwd()  # needed for no effect on other doctests
  >>> os.chdir(cocopp.toolsdivers.path_in_package())
  >>> cocopp.ppfig.consecutiveNumbers([0, 1, 2, 4, 5, 7, 8, 9])
  '0-2, 4, 5, 7-9'
  >>> cocopp.ppfig.consecutiveNumbers([0, 1, 2, 4, 5, 7, 8, 9], 'f')
  'f0-f2, f4, f5, f7-f9'
  >>> os.chdir(returnpath)  # no effect on path from this doctest

Range of consecutive numbers is at least 3 (therefore [4, 5] is
represented as "4, 5").
def groupByRange(data):

Groups a sequence of integers into ranges of consecutive numbers.

Helper function of consecutiveNumbers(data), returns a list of lists. The key to the solution is differencing with a range so that consecutive numbers all appear in same group. Useful for determining ranges of functions. Ref: http://docs.python.org/release/3.0.1/library/itertools.html

def logxticks(limits=[-np.inf, np.inf]):

Modify log-scale figure xticks from 10^i to i for values with the limits and (re-)sets the current xlim() thereby turning autoscale off (if it was on).

This is to have xticks that are more visible. Modifying the x-limits of the figure after calling this method will not update the ticks. Please make sure the xlabel is changed accordingly.

def beautify():
deprecated method - not used anywhere Customize a figure by adding a legend, axis label, etc.
def generateData(dataSet, targetFuncValue):

Returns an array of results to be plotted.

1st column is ert, 2nd is the number of success, 3rd the success rate, 4th the sum of the number of function evaluations, and finally the median on successful runs.

def plot(dsList, _valuesOfInterest=(10, 1, 0.1, 0.01, 0.001, 1e-05, 1e-08), isbyinstance=True, kwargs={}):
From a DataSetList, plot a graph. Not in use and superseeded by ppfigdim.main!?
def get_first_html_file(current_dir, prefix):
Undocumented
def get_sorted_html_files(current_dir, prefix):
Undocumented
def get_plotting_styles(algorithms, only_foreground=False):
Undocumented
def getFontSize(nameList):
Undocumented
API Documentation for cocopp, generated by pydoctor at 2020-01-21 16:27:37.