Skip to content

Instantly share code, notes, and snippets.

@ThomasVille
Last active March 19, 2017 18:27
Show Gist options
  • Select an option

  • Save ThomasVille/a074520bf4a023bf3e4bcd635968a135 to your computer and use it in GitHub Desktop.

Select an option

Save ThomasVille/a074520bf4a023bf3e4bcd635968a135 to your computer and use it in GitHub Desktop.
Plotting multiple plots on the same graph with PLplot
// 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