<commit_before>from mpl_toolkits.mplot3d import Axes3D  # noqa

import numpy as np
from matplotlib import pyplot, cm


def plot_field(field, xmax=2., ymax=2., zmax=None, view=None, linewidth=0):
    """Utility plotting routine for 2D data

    :param field: Numpy array with field data to plot
    :param xmax: (Optional) Length of the x-axis
    :param ymax: (Optional) Length of the y-axis
    :param view: (Optional) View point to intialise
    """
    x_coord = np.linspace(0, xmax, field.shape[0])
    y_coord = np.linspace(0, ymax, field.shape[1])
    fig = pyplot.figure(figsize=(11, 7), dpi=100)
    ax = fig.gca(projection='3d')
    X, Y = np.meshgrid(x_coord, y_coord)<commit_msg>Fix for `plot_field` function failing on non-square grids #666 <commit_after>from mpl_toolkits.mplot3d import Axes3D  # noqa

import numpy as np
from matplotlib import pyplot, cm


def plot_field(field, xmax=2., ymax=2., zmax=None, view=None, linewidth=0):
    """Utility plotting routine for 2D data

    :param field: Numpy array with field data to plot
    :param xmax: (Optional) Length of the x-axis
    :param ymax: (Optional) Length of the y-axis
    :param view: (Optional) View point to intialise
    """
    x_coord = np.linspace(0, xmax, field.shape[0])
    y_coord = np.linspace(0, ymax, field.shape[1])
    fig = pyplot.figure(figsize=(11, 7), dpi=100)
    ax = fig.gca(projection='3d')
    X, Y = np.meshgrid(x_coord, y_coord, indexing='ij')
{'fraction_non_alphanumeric': 0.12179930795847752, 'fraction_numerical': 0.02560553633217993, 'mean_word_length': 3.885135135135135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '314405', 'n_tokens_mistral': 542, 'n_tokens_neox': 526, 'n_words': 159}