chickenservice / matplotlib.net

A wrapper to embed interactive matplotlib in WPF applications
MIT License
1 stars 1 forks source link

Question~ #1

Open Flowergift opened 1 month ago

Flowergift commented 1 month ago

Hello!

I have one question.

Can somebody help me to launch this code in my Win11 64 bit with my VS2022?

There are some throw exceptions like below~

And for python.dll, actually I'm using python310.dll and exception threw~ And then I've downloaded python.dll file.

But still same problem~

============================================================================

TypeInitializationException: The type initializer for 'Matplotlib.Net.MplPanel' threw an exception.

TypeInitializationException: The type initializer for 'Delegates' threw an exception.

DllNotFoundException: Could not load /python.dll.

Win32Exception: can not find module.

============================================================================

chickenservice commented 1 week ago

Hi, sorry for my late reply. I haven't been able to work on this in some time. It's still a prototype so I haven't included any setup instructions. I hope I'll get around to it soon, glad to see someone is interested!

Flowergift commented 1 week ago

Dear Alessio Eberl Sir(?),

Thank you for your reply.

But..

I can not understand what "I'll get around to it soon" means for..

Are there any other developers besides you?

In spite of it is a "prototype", I hope to run in my VS2022 without any errors.

Please help me~

I don't know what was the problem with my VS2022. I can not find out and can not debug some errors.

On Sun, Nov 17, 2024 at 10:44 PM Alessio Eberl @.***> wrote:

Hi, sorry for my late reply. I haven't been able to work on this in some time. It's still a prototype so I haven't included any setup instructions. I hope I'll get around to it soon, glad to see someone is interested!

— Reply to this email directly, view it on GitHub https://github.com/chickenservice/matplotlib.net/issues/1#issuecomment-2481272213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZLGLBJVKVVAASXCV25Y7BD2BCMSXAVCNFSM6AAAAABPPPM4OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRGI3TEMRRGM . You are receiving this because you authored the thread.Message ID: @.***>

Flowergift commented 1 week ago

I can understand what you meant. ( I'll get around to it soon)

I hope you can help me~

On Mon, Nov 18, 2024 at 12:48 AM BGM @.***> wrote:

Dear Alessio Eberl Sir(?),

Thank you for your reply.

But..

I can not understand what "I'll get around to it soon" means for..

Are there any other developers besides you?

In spite of it is a "prototype", I hope to run in my VS2022 without any errors.

Please help me~

I don't know what was the problem with my VS2022. I can not find out and can not debug some errors.

On Sun, Nov 17, 2024 at 10:44 PM Alessio Eberl @.***> wrote:

Hi, sorry for my late reply. I haven't been able to work on this in some time. It's still a prototype so I haven't included any setup instructions. I hope I'll get around to it soon, glad to see someone is interested!

— Reply to this email directly, view it on GitHub https://github.com/chickenservice/matplotlib.net/issues/1#issuecomment-2481272213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZLGLBJVKVVAASXCV25Y7BD2BCMSXAVCNFSM6AAAAABPPPM4OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRGI3TEMRRGM . You are receiving this because you authored the thread.Message ID: @.***>

Flowergift commented 1 week ago

FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional.

The appsettings.json file needed?

Actually I don't know what this is...

On Mon, Nov 18, 2024 at 2:16 PM BGM @.***> wrote:

I can understand what you meant. ( I'll get around to it soon)

I hope you can help me~

On Mon, Nov 18, 2024 at 12:48 AM BGM @.***> wrote:

Dear Alessio Eberl Sir(?),

Thank you for your reply.

But..

I can not understand what "I'll get around to it soon" means for..

Are there any other developers besides you?

In spite of it is a "prototype", I hope to run in my VS2022 without any errors.

Please help me~

I don't know what was the problem with my VS2022. I can not find out and can not debug some errors.

On Sun, Nov 17, 2024 at 10:44 PM Alessio Eberl @.***> wrote:

Hi, sorry for my late reply. I haven't been able to work on this in some time. It's still a prototype so I haven't included any setup instructions. I hope I'll get around to it soon, glad to see someone is interested!

— Reply to this email directly, view it on GitHub https://github.com/chickenservice/matplotlib.net/issues/1#issuecomment-2481272213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZLGLBJVKVVAASXCV25Y7BD2BCMSXAVCNFSM6AAAAABPPPM4OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRGI3TEMRRGM . You are receiving this because you authored the thread.Message ID: @.***>

Flowergift commented 5 days ago

Dear Alessio Eberl,

For one more thing.

Actually I need just python "graph/2D graphic/3D graphic" matplotlib source code to C# wpf window's inline(embedded) view. (Not new windows open for plt.show())

I want to give you 2 examples.

Ex1)

Exploring Matplotlib Inline: A Quick Tutorial | DataCamp https://www.datacamp.com/tutorial/exploring-matplotlib-inline-a-quick-tutorial

This is tutorial for inline graph view in Jupyter notebook (Or google colab)

Of course this can be run for the "%matplotlib inline" command.

But this is not what I want to~

[image: image.png]

Ex2)

This example is very similar to your project. (Not same as you know)

Using Python's Matplotlib to render figures in a .Net WPF application https://www.quantfns.com/integpython-net-matplotlib

Actually this structure is...

1) Changed minor python code to C# wpf code and then somehow displayed in WPF inline windows (Not new windows open~) "minor" means easy code change~ "major" means original language grammar to C# wpf.

 var fitr = npi.polyfit(x.PyObject, y.PyObject, deg: 1);
 double a = fitr[0];
 double b = fitr[1];
 var y_est = a * x + b;
 var y_err = x.std() * np.sqrt( np.power((x - x.mean()), np.array(2)) /

np.sum(np.power((x - x.mean()) , np.array(2))) +1.0 / N );

 You can see these above is "minor" = "forcely"  some code changed to

C# wpf.

[image: image.png]

Anyway, when I'd tried to compile and run the above link code in my VS2022,

(var pyfig, var ax) = pyplot.subplots(figsize: new List { 3, 3 }, dpi: dpi);

This is error~ Maybe this is not correct "minor" code change to C# wpf code.

Actually I want to run (plot) python code by "PythonEngine.CompileFile("PythonFile.py");" [Separated .py file and just added in my working VS2022. Not code change like above~]

and then "PythonEngine.Execute("PythonFile.py")"

If this is hard working, just above minor code change method would be welcomed for me~

But I don't know how I should debug code errors~ (var pyfig, var ax) = pyplot.subplots(figsize: new List {3, 3}, dpi : dpi)

2) the above example shows "bitmap wpf window box" display the python 2D graph~

But I don't know if it can display a python 3D graph in a bitmap wpf window box? Have you experienced this?

Of course I SHOULD NOT USE wpf's 3D graphic lib and Oxyplots. Only inline matplotlib can~

Can you help me? Or Would you rework your project with me? I also can help you~

On Sun, Nov 17, 2024 at 10:44 PM Alessio Eberl @.***> wrote:

Hi, sorry for my late reply. I haven't been able to work on this in some time. It's still a prototype so I haven't included any setup instructions. I hope I'll get around to it soon, glad to see someone is interested!

— Reply to this email directly, view it on GitHub https://github.com/chickenservice/matplotlib.net/issues/1#issuecomment-2481272213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZLGLBJVKVVAASXCV25Y7BD2BCMSXAVCNFSM6AAAAABPPPM4OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRGI3TEMRRGM . You are receiving this because you authored the thread.Message ID: @.***>