Skip to content

plot_genes() missing matplt() #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tlint101 opened this issue Jan 27, 2025 · 1 comment
Open

plot_genes() missing matplt() #315

tlint101 opened this issue Jan 27, 2025 · 1 comment

Comments

@tlint101
Copy link

Hello,

I noticed in PyGAD 3.4.0, calling the plot_genes() method brings the following error:

in Plot.plot_genes(self, title, xlabel, ylabel, linewidth, font_size, plot_type, graph_type, fill_color, color, solutions, save_dir)
    274     ax.set_xlabel(0, fontsize=font_size)
    275 else:
--> 276     fig, axs = matplt.subplots(num_rows, num_cols)
    278     if num_cols == 1 and num_rows == 1:
    279         fig.set_figwidth(5 * num_cols)

NameError: name 'matplt' is not defined

I think the method is missing the following function (which is present in the other plot methods):

matplt = get_matplotlib()
@ahmedfgad
Copy link
Owner

Thanks! Fixed and will be available in the next release: 22b579f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants