Debian Codegraph @

docs/source/tutorial/s4_save_plots.rst

raw
1 Customizing and saving plots
2 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 .. _raw_save_plot:
4
5 This tutorial covers how to customize plots in RAW and save plots from RAW.
6 Note that RAW is not meant to be a program for making publication quality
7 plots, and has a number of limitations when it comes to plots, but some people
8 find it convenient to use the plots made in RAW for various purposes.
9
10 The written version of the tutorial follows.
11
12 Customizing plots in RAW
13 *****************************
14
15 #. Load the **glucose_isomerase.dat** dataset in the reconstruction_data folder.
16
17 #. Use the "1" button in the plot toolbar at the bottom of the RAW window to
18 show just the Main Plot.
19
20 |show_plot1_png|
21
22 #. Right click on the plot and select "Plot Options..." in the right click menu.
23
24 * *Note:* Plot options only affects the plot you click on. Each plot has its
25 own set of options.
26
27 |show_plot_options_png|
28
29 #. In the options window that opens, do the following: remove the plot title,
30 turn on the legend, change the font for all items to Arial.
31
32 * *Note:* Not all fonts are available on all systems, you may have to select
33 a different font.
34
35 |plot_options1_png|
36
37 #. In the options window, do the following: Turn on the Top and Right borders,
38 Change the x-axis label to give the q units, as "$q$ $[1/\\AA]$". Click "Okay"
39 to exit the plot options window.
40
41 * *Tip:* Anything inside of "$" signs in a plot label or legend label is
42 parsed as a TeX markup, which allows you to use special symbols like
43 the angstrom symbol, Å, as $\\AA$. A useful guide to allowed formatting
44 and special characters input can be found in the matplotlib documentation:
45 https://matplotlib.org/stable/tutorials/text/mathtext.html
46
47 |plot_options2_png|
48
49 #. Checkpoint. Your plot should now look like this
50
51 |plot_checkpoint1_png|
52
53 #. Adjust the size of the RAW window to adjust the aspect ratio of the plot and
54 make it roughly square.
55
56 #. Use the horizontal slider bar button in the plot toolbar to open the margin
57 adjustment for the plot.
58
59 |plot_margins1_png|
60
61 #. In the window that opens, use the left, right, top, and bottom sliders
62 to bring the edges of the plot close to the edges of the window. Close the
63 margin adjustment window when done.
64
65 |plot_margins2_png|
66
67 #. Click on the colored line in the glucose_isomerase.dat item in the Profiles
68 Control Panel to open the Line Properties window.
69
70 |plot_line_properties1_png|
71
72 #. In the Line Properties window, set the Legend Label to "Glucose Isomerase",
73 Set the Line "Style" to "None". Set the Data Point Marker "Marker" to ".".
74 Set the marker "Size" to "4". Set all the Colours to green. Set the Error
75 Bars "Width" to 0.25. Click "OK" to exit the line properties dialog.
76
77 |plot_line_properties2_png|
78
79 #. Use the error bar button in the plot toolbar to turn on error bars for
80 the plot.
81
82 |plot_errorbars_png|
83
84 #. Checkpoint. Your plot should now look like this:
85
86 |plot_checkpoint2_png|
87
88 #. Open the plot Options dialog again. Turn off autolimits and adjust the y limits
89 To have a minimum of 2e-5 and a maximum of 0.065.
90
91 * *Tip:* You can also use the crossed arrows and the magnifying glass
92 in the plot toolbar to adjust the scale of the plot.
93
94 |plot_options3_png|
95
96 #. Click on the legend text ("Glucose Isomerase") and drag the legend to a new
97 position in the plot (e.g. a bit further away from the top right corner).
98
99 #. You've now adjusted everything that you can about the plot in RAW. Your plot
100 should look like this:
101
102 |plot_checkpoint3_png|
103
104
105 Note: All of the main plots in RAW ("Profiles", "IFTs", "Series") can be
106 customized in a similar way. All of the items in the control panel have
107 the line options dialogs. All of the plots have plot options. Analysis
108 plots (such as the Guinier plot) don't generally have most of these customization
109 options. All of the analysis plots will have the ability to set the margins and
110 to zoom/drag to adjust what's visible, not nothing else. The exception to this
111 is the Dimensionless Krakty plot, where you can adjust the line color (but nothing else).
112
113 Note: You can customize plot 1, plot 2, or plots 1 and 2 in panels with multiple plots.
114 This example used only plot 1 for convenience, but you could use either or both plots
115 as desired.
116
117
118 Saving plots in RAW
119 *****************************
120
121 #. Click the Save icon in the plot toolbar at the bottom of the plot window to
122 open the save dialog.
123
124 |plot_save_png|
125
126 #. Select an appropriate file type, filename, and location, then save the image.
127
128 Note: We recommend using vector graphics formats for plots that you'll be including
129 in presentations or papers. Vector graphics are images that can be rescaled
130 (preserving aspect ratio) arbitrarily without loss of quality. We recommend the
131 "Scalable Vector Graphics" (.svg) format for vector graphics saved with
132 RAW, but you can select other options as it suits your needs. For raster
133 graphics (e.g. images with a defined set of pixels) we recommend "Portable
134 Network File" (.png) as it has lossless compression.
135
136
137 .. |show_plot1_png| image:: images/show_plot1.png
138 :target: ../_images/show_plot1.png
139
140 .. |show_plot_options_png| image:: images/show_plot_options.png
141 :target: ../_images/show_plot_options.png
142
143 .. |plot_options1_png| image:: images/plot_options1.png
144 :target: ../_images/plot_options1.png
145
146 .. |plot_options2_png| image:: images/plot_options2.png
147 :target: ../_images/plot_options2.png
148
149 .. |plot_checkpoint1_png| image:: images/plot_checkpoint1.png
150 :target: ../_images/plot_checkpoint1.png
151
152 .. |plot_margins1_png| image:: images/plot_margins1.png
153 :target: ../_images/plot_margins1.png
154 :width: 400 px
155
156 .. |plot_margins2_png| image:: images/plot_margins2.png
157 :target: ../_images/plot_margins2.png
158
159 .. |plot_line_properties1_png| image:: images/plot_line_properties1.png
160 :target: ../_images/plot_line_properties1.png
161 :width: 400 px
162
163 .. |plot_line_properties2_png| image:: images/plot_line_properties2.png
164 :target: ../_images/plot_line_properties2.png
165 :width: 450 px
166
167 .. |plot_errorbars_png| image:: images/plot_errorbars.png
168 :target: ../_images/plot_errorbars.png
169 :width: 400 px
170
171 .. |plot_checkpoint2_png| image:: images/plot_checkpoint2.png
172 :target: ../_images/plot_checkpoint2.png
173
174 .. |plot_options3_png| image:: images/plot_options3.png
175 :target: ../_images/plot_options3.png
176
177 .. |plot_checkpoint3_png| image:: images/plot_checkpoint3.png
178 :target: ../_images/plot_checkpoint3.png
179
180 .. |plot_save_png| image:: images/plot_save.png
181 :target: ../_images/plot_save.png
182 :width: 400 px