-
-
Notifications
You must be signed in to change notification settings - Fork 7
Save Plot to a file
kojix2 edited this page Jun 16, 2020
·
10 revisions
If you are using GR::Plot
, call savefig
method.
require 'gr/plot'
x = [1, 2, 3, 4, 5]
y = [1, 8, 27, 64, 125]
GR.plot(x, y)
GR.savefig('savefig/image.pdf')
GR.savefig('savefig/image.ps')
GR.savefig('savefig/image.gif')
GR.savefig('savefig/image.bmp')
GR.savefig('savefig/image.jpg')
GR.savefig('savefig/image.png')
GR.savefig('savefig/image.tiff')
GR.savefig('savefig/image.svg')
You can add keyword values.
GR.savefig('savefig/image.pdf', title: 'PDF')
GR.savefig('savefig/image.ps', title: 'PS')
GR.savefig('savefig/image.gif', title: 'GIF')
GR.savefig('savefig/image.bmp', title: 'BMP')
GR.savefig('savefig/image.jpg', title: 'JPG')
GR.savefig('savefig/image.png', title: 'PNG')
GR.savefig('savefig/image.tiff', title: 'TIFF')
GR.savefig('savefig/image.svg', title: 'SVG')
beginprint
endprint
User's Guide
Simple, matlab-style API
- Plotting functions
- Plot attributes
- Multiple plots
- Multiple subplots
- Save Plot to a file
- Jupyter Notebook
GR Native functions
For developers