Skip to content

Can't assign matplotlib figure object to variable. #7

@RJaBi

Description

@RJaBi

Currently it isn't possible to assign a matplotlib object to a variable. This might be useful as in

fig, ax = plt.subplots()

of the python code example http://matplotlib.org/examples/api/patch_collection.html .

Sample code demonstrating this is,

import plt = matplotlibd.pyplot;

void main()
{
auto figure = plt.figure;
}

results in the error:

Performing "debug" build using /home/user/Downloads/dmd/dmd2.072.2/linux/bin64/dmd for x86_64.
matplotlib-d 0.1.4: building configuration "library"...
Running pre-build commands...
simple_example ~master: building configuration "application"...
Running pre-build commands...
source/app.d(5,8): Error: variable app.main.figure type void is inferred from initializer figure(), and variables cannot be of type void
source/app.d(5,20): Error: expression figure() is void and has no value
/home/user/Downloads/dmd/dmd2.072.2/linux/bin64/dmd failed with exit code 1

This isn't actually the use I need (I need a PdfPages object from the matplotlib.backends.backend_pdf which I can import successfully with some small changes to matplotlib-d -> #8 ) but the error is the same and this is in the repo.

Finally thanks for this repo, it's a promising idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions