# Matplot using on Node-RED

**URL:** https://discourse.nodered.org/t/matplot-using-on-node-red/18162
**Category:** General
**Created:** [19 November 2019 19:37 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162 "2019-11-19T19:37:19Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 November 2019 09:31 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/21 "2019-11-20T09:31:56Z")

</div>

OK, so the command will not run on the server in a terminal, in that case it is not going to run in an exec node either.

---

<div class="post-metadata">

### Author: ![ALOKA1432](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@ALOKA1432](https://discourse.nodered.org/u/ALOKA1432)
#### Post date: [20 November 2019 09:33 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/22 "2019-11-20T09:33:48Z")

</div>

@Colin Yup. I have to install a dekstop environment. All are more than a GB. Do you know any lightweight desktop environment for ubuntu ?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 November 2019 09:35 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/23 "2019-11-20T09:35:12Z")

</div>

I don't think matlab is the right tool for the job. You need to find command line tools that will do whatever you need to do.

---

<div class="post-metadata">

### Author: ![ALOKA1432](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@ALOKA1432](https://discourse.nodered.org/u/ALOKA1432)
#### Post date: [20 November 2019 09:36 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/24 "2019-11-20T09:36:16Z")

</div>

Any suggestion?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 November 2019 09:38 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/25 "2019-11-20T09:38:08Z")

</div>

Since you haven't given a clue about what you are trying to do then no I haven't. However a node-red forum is unlikely to be the best place to ask that.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [20 November 2019 09:39 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/26 "2019-11-20T09:39:28Z")

</div>

Reading the matplotlib documentation, instead of spawning a window, you can save the output to an svg or png.  
I even see output to plotly, you could use this to show it on the node-red dashboard. These options will limit interactivity compared to a window, but it could work.

---

<div class="post-metadata">

### Author: ![ALOKA1432](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@ALOKA1432](https://discourse.nodered.org/u/ALOKA1432)
#### Post date: [20 November 2019 09:40 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/27 "2019-11-20T09:40:41Z")

</div>

Thanks @bakman2

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [20 November 2019 10:51 UTC](https://discourse.nodered.org/t/matplot-using-on-node-red/18162/28 "2019-11-20T10:51:15Z")

</div>

Bokeh might be another solution, but the JS side of things when working between python and JavaScript take a lot of time setting up.  
[https://docs.bokeh.org/en/latest/index.html](https://docs.bokeh.org/en/latest/index.html)

I’ve good experience with an environment that is a mix of python and js using Baidu’s eCharts.  
What I do there is have python do the processing of data, then output all needed info in a dict, which is then converted to json and returned. When doing this with an exec node, you would print the json to stdout, use a json node to get it back in object form, then set up the echarts instance in a dashboard template node and make sure it comes in there. Personally I don’t use the dashboard nodes but uibuilder for this but both situations should work.  
[https://www.echartsjs.com/en/index.html](https://www.echartsjs.com/en/index.html)

[Previous page](https://discourse.nodered.org/t/matplot-using-on-node-red/18162.md?page=1)
