# Plotting with JuMP variables

**URL:** https://discourse.julialang.org/t/plotting-with-jump-variables/18255
**Category:** Optimization (Mathematical)
**Created:** [December 3, 2018, 4:25pm UTC](https://discourse.julialang.org/t/plotting-with-jump-variables/18255 "2018-12-03T16:25:29Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [December 3, 2018, 5:19pm UTC](https://discourse.julialang.org/t/plotting-with-jump-variables/18255/2 "2018-12-03T17:19:54Z")

</div>

You can’t plot JuMP variables as they are. What you can do is plot the solution values of the JuMP variables.

So if `x` is your JuMP variable, call `x_sol = JuMP.get_value(x)` and then plot `x_sol` instead of `x`.

p.s. when posting questions like this, you should include a reproducible example. Take a read of:

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

_[View the full topic](https://discourse.julialang.org/t/plotting-with-jump-variables/18255)._
