How to plot the result got by Gurobi?Calling a function of a module by using its name (a string)How to merge two dictionaries in a single expression?How do I check whether a file exists without exceptions?Getting the class name of an instance?Proper way to declare custom exceptions in modern Python?Use of *args and **kwargsImporting files from different folderHow to prettyprint a JSON file?How to iterate over rows in a DataFrame in Pandas?Why is “1000000000000000 in range(1000000000000001)” so fast in Python 3?
How can I get a job without pushing my family's income into a higher tax bracket?
Alias to source .bashrc after it's been edited?
CRT Oscilloscope - part of the plot is missing
A non-technological, repeating, phenomenon in the sky, holding its position in the sky for hours
Was there ever a Kickstart that took advantage of 68020+ instructions that would work on an A2000?
Why do money exchangers give different rates to different bills?
How did Arya get her dagger back from Sansa?
Did we get closer to another plane than we were supposed to, or was the pilot just protecting our delicate sensibilities?
Why is Arya visibly scared in the library in S8E3?
Would a 1/1 token with persist dying trigger on death effects a second time?
Pawn Promotion Double Checks
Can Ghost kill White Walkers or Wights?
What was the state of the German rail system in 1944?
Do I have to make someone coauthor if he/she solves a problem in StackExchange, asked by myself, which is later used in my paper?
How could a planet have most of its water in the atmosphere?
Python password manager
Selecting a secure PIN for building access
Why was the battle set up *outside* Winterfell?
Should I replace my bicycle tires if they have not been inflated in multiple years
How do I tell my manager that his code review comment is wrong?
Point of the the Dothraki's attack in GoT S8E3?
What word means "to make something obsolete"?
What happens to matryoshka Mordenkainen's Magnificent Mansions?
Would glacier 'trees' be plausible?
How to plot the result got by Gurobi?
Calling a function of a module by using its name (a string)How to merge two dictionaries in a single expression?How do I check whether a file exists without exceptions?Getting the class name of an instance?Proper way to declare custom exceptions in modern Python?Use of *args and **kwargsImporting files from different folderHow to prettyprint a JSON file?How to iterate over rows in a DataFrame in Pandas?Why is “1000000000000000 in range(1000000000000001)” so fast in Python 3?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
After I run the Gurobi model, I want to draw a scatter plot, where time is the x-axis and objective function value is the y-axis. How can I do it?
I notice there is a file named "gurobi" which has the values of time and objective function, but I want to plot it directly in Python.
python gurobi
add a comment |
After I run the Gurobi model, I want to draw a scatter plot, where time is the x-axis and objective function value is the y-axis. How can I do it?
I notice there is a file named "gurobi" which has the values of time and objective function, but I want to plot it directly in Python.
python gurobi
Thanks for the correction!
– Zed
Mar 26 at 2:22
add a comment |
After I run the Gurobi model, I want to draw a scatter plot, where time is the x-axis and objective function value is the y-axis. How can I do it?
I notice there is a file named "gurobi" which has the values of time and objective function, but I want to plot it directly in Python.
python gurobi
After I run the Gurobi model, I want to draw a scatter plot, where time is the x-axis and objective function value is the y-axis. How can I do it?
I notice there is a file named "gurobi" which has the values of time and objective function, but I want to plot it directly in Python.
python gurobi
python gurobi
edited Mar 23 at 0:23
karel
2,35392832
2,35392832
asked Mar 22 at 21:17
ZedZed
32
32
Thanks for the correction!
– Zed
Mar 26 at 2:22
add a comment |
Thanks for the correction!
– Zed
Mar 26 at 2:22
Thanks for the correction!
– Zed
Mar 26 at 2:22
Thanks for the correction!
– Zed
Mar 26 at 2:22
add a comment |
1 Answer
1
active
oldest
votes
If you have data set you can use Matplotlib library to plot any kind of plot. it would be more clear if you share your sample code. by the way here are simple example here:https://matplotlib.org/gallery/shapes_and_collections/scatter.html
Thanks for your answer! What I want to know is whether or not Gurobi has a method which can plot the improvement directly. Because if I plot the data by using Matplotlib, I need to modify the data set a lot.
– Zed
Mar 25 at 15:30
1
As per my understanding,there is no direct way to plot results by Gurobi.I checked Gurobi if you require to illustrate changes it would use same way [link]gurobi.com/resources/examples/example-models-overviewA Python-only example that solves a financial portfolio optimization model, where the historical return data is stored using the pandas package and the result is plotted using the matplotlib package. It demonstrates the use of pandas, NumPy, and Matplotlib in conjunction with Gurobi.
– Mohsen
Mar 26 at 4:03
Thanks, it helps a lot!
– Zed
Mar 27 at 14:49
Could you tell me where can I find the raw data named "portfolio.csv"?
– Zed
Mar 27 at 15:22
You question is unclear! you initiate question and confirm that you have output data. By the way you can save values in csv format usingdf.to_csv('output.csv')
, df is your Data Frame.
– Mohsen
Mar 28 at 12:41
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307906%2fhow-to-plot-the-result-got-by-gurobi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you have data set you can use Matplotlib library to plot any kind of plot. it would be more clear if you share your sample code. by the way here are simple example here:https://matplotlib.org/gallery/shapes_and_collections/scatter.html
Thanks for your answer! What I want to know is whether or not Gurobi has a method which can plot the improvement directly. Because if I plot the data by using Matplotlib, I need to modify the data set a lot.
– Zed
Mar 25 at 15:30
1
As per my understanding,there is no direct way to plot results by Gurobi.I checked Gurobi if you require to illustrate changes it would use same way [link]gurobi.com/resources/examples/example-models-overviewA Python-only example that solves a financial portfolio optimization model, where the historical return data is stored using the pandas package and the result is plotted using the matplotlib package. It demonstrates the use of pandas, NumPy, and Matplotlib in conjunction with Gurobi.
– Mohsen
Mar 26 at 4:03
Thanks, it helps a lot!
– Zed
Mar 27 at 14:49
Could you tell me where can I find the raw data named "portfolio.csv"?
– Zed
Mar 27 at 15:22
You question is unclear! you initiate question and confirm that you have output data. By the way you can save values in csv format usingdf.to_csv('output.csv')
, df is your Data Frame.
– Mohsen
Mar 28 at 12:41
add a comment |
If you have data set you can use Matplotlib library to plot any kind of plot. it would be more clear if you share your sample code. by the way here are simple example here:https://matplotlib.org/gallery/shapes_and_collections/scatter.html
Thanks for your answer! What I want to know is whether or not Gurobi has a method which can plot the improvement directly. Because if I plot the data by using Matplotlib, I need to modify the data set a lot.
– Zed
Mar 25 at 15:30
1
As per my understanding,there is no direct way to plot results by Gurobi.I checked Gurobi if you require to illustrate changes it would use same way [link]gurobi.com/resources/examples/example-models-overviewA Python-only example that solves a financial portfolio optimization model, where the historical return data is stored using the pandas package and the result is plotted using the matplotlib package. It demonstrates the use of pandas, NumPy, and Matplotlib in conjunction with Gurobi.
– Mohsen
Mar 26 at 4:03
Thanks, it helps a lot!
– Zed
Mar 27 at 14:49
Could you tell me where can I find the raw data named "portfolio.csv"?
– Zed
Mar 27 at 15:22
You question is unclear! you initiate question and confirm that you have output data. By the way you can save values in csv format usingdf.to_csv('output.csv')
, df is your Data Frame.
– Mohsen
Mar 28 at 12:41
add a comment |
If you have data set you can use Matplotlib library to plot any kind of plot. it would be more clear if you share your sample code. by the way here are simple example here:https://matplotlib.org/gallery/shapes_and_collections/scatter.html
If you have data set you can use Matplotlib library to plot any kind of plot. it would be more clear if you share your sample code. by the way here are simple example here:https://matplotlib.org/gallery/shapes_and_collections/scatter.html
answered Mar 22 at 21:31
MohsenMohsen
391111
391111
Thanks for your answer! What I want to know is whether or not Gurobi has a method which can plot the improvement directly. Because if I plot the data by using Matplotlib, I need to modify the data set a lot.
– Zed
Mar 25 at 15:30
1
As per my understanding,there is no direct way to plot results by Gurobi.I checked Gurobi if you require to illustrate changes it would use same way [link]gurobi.com/resources/examples/example-models-overviewA Python-only example that solves a financial portfolio optimization model, where the historical return data is stored using the pandas package and the result is plotted using the matplotlib package. It demonstrates the use of pandas, NumPy, and Matplotlib in conjunction with Gurobi.
– Mohsen
Mar 26 at 4:03
Thanks, it helps a lot!
– Zed
Mar 27 at 14:49
Could you tell me where can I find the raw data named "portfolio.csv"?
– Zed
Mar 27 at 15:22
You question is unclear! you initiate question and confirm that you have output data. By the way you can save values in csv format usingdf.to_csv('output.csv')
, df is your Data Frame.
– Mohsen
Mar 28 at 12:41
add a comment |
Thanks for your answer! What I want to know is whether or not Gurobi has a method which can plot the improvement directly. Because if I plot the data by using Matplotlib, I need to modify the data set a lot.
– Zed
Mar 25 at 15:30
1
As per my understanding,there is no direct way to plot results by Gurobi.I checked Gurobi if you require to illustrate changes it would use same way [link]gurobi.com/resources/examples/example-models-overviewA Python-only example that solves a financial portfolio optimization model, where the historical return data is stored using the pandas package and the result is plotted using the matplotlib package. It demonstrates the use of pandas, NumPy, and Matplotlib in conjunction with Gurobi.
– Mohsen
Mar 26 at 4:03
Thanks, it helps a lot!
– Zed
Mar 27 at 14:49
Could you tell me where can I find the raw data named "portfolio.csv"?
– Zed
Mar 27 at 15:22
You question is unclear! you initiate question and confirm that you have output data. By the way you can save values in csv format usingdf.to_csv('output.csv')
, df is your Data Frame.
– Mohsen
Mar 28 at 12:41
Thanks for your answer! What I want to know is whether or not Gurobi has a method which can plot the improvement directly. Because if I plot the data by using Matplotlib, I need to modify the data set a lot.
– Zed
Mar 25 at 15:30
Thanks for your answer! What I want to know is whether or not Gurobi has a method which can plot the improvement directly. Because if I plot the data by using Matplotlib, I need to modify the data set a lot.
– Zed
Mar 25 at 15:30
1
1
As per my understanding,there is no direct way to plot results by Gurobi.I checked Gurobi if you require to illustrate changes it would use same way [link]gurobi.com/resources/examples/example-models-overview
A Python-only example that solves a financial portfolio optimization model, where the historical return data is stored using the pandas package and the result is plotted using the matplotlib package. It demonstrates the use of pandas, NumPy, and Matplotlib in conjunction with Gurobi.
– Mohsen
Mar 26 at 4:03
As per my understanding,there is no direct way to plot results by Gurobi.I checked Gurobi if you require to illustrate changes it would use same way [link]gurobi.com/resources/examples/example-models-overview
A Python-only example that solves a financial portfolio optimization model, where the historical return data is stored using the pandas package and the result is plotted using the matplotlib package. It demonstrates the use of pandas, NumPy, and Matplotlib in conjunction with Gurobi.
– Mohsen
Mar 26 at 4:03
Thanks, it helps a lot!
– Zed
Mar 27 at 14:49
Thanks, it helps a lot!
– Zed
Mar 27 at 14:49
Could you tell me where can I find the raw data named "portfolio.csv"?
– Zed
Mar 27 at 15:22
Could you tell me where can I find the raw data named "portfolio.csv"?
– Zed
Mar 27 at 15:22
You question is unclear! you initiate question and confirm that you have output data. By the way you can save values in csv format using
df.to_csv('output.csv')
, df is your Data Frame.– Mohsen
Mar 28 at 12:41
You question is unclear! you initiate question and confirm that you have output data. By the way you can save values in csv format using
df.to_csv('output.csv')
, df is your Data Frame.– Mohsen
Mar 28 at 12:41
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307906%2fhow-to-plot-the-result-got-by-gurobi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Thanks for the correction!
– Zed
Mar 26 at 2:22