Last active
March 19, 2017 18:27
-
-
Save ThomasVille/a074520bf4a023bf3e4bcd635968a135 to your computer and use it in GitHub Desktop.
Plotting multiple plots on the same graph with PLplot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Output type and file | |
| plsfnam("filename.svg"); | |
| plsdev("svg"); | |
| plinit(); | |
| // Set the canvas to show 2x2 plots | |
| plssub( 2, 2 ); | |
| for(int i = 0; i < 4; i++) | |
| { | |
| // Very important ! Go to the next plot spot with plenv | |
| plenv(xMin[i], xMax[i], yMin[i], yMax[i], 0, 0); | |
| // Set the axes titles | |
| pllab( "False Positive Rate", "True Positive Rate", testSet.first.c_str() ); | |
| // Fancy color for each plot | |
| plcol0(i+2); | |
| // Plot interesting things | |
| plline(testSet.second.size(), x[i], y[i]); | |
| plpoin(testSet.second.size(), x[i], y[i], 3); | |
| } | |
| // Don't forget to release | |
| plend(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment