BU-hammerTeam / PyHammer

A Python Spectral Typing Suite
MIT License
53 stars 14 forks source link

PyHammer Eyecheck Default Display on MacOS Terminal Bash Shell #33

Closed JosephKarpinski closed 6 years ago

JosephKarpinski commented 6 years ago

PyHammer Eyecheck default display under Spyder is well sized and looks great. Eyecheck display under Terminal, not so much. Way to large, and requires constant resizing. Almost never want to run it that way, and are forced to run PyHammer under Spyder, to make it user friendly. Is there anything that can be done to the PyHammer Eyecheck default display under Terminal? See attachment:

display_issue

zephyr5050 commented 6 years ago

This issue is purely a function of your computer and its resolution and settings. The best I can tell you is to go into the code itself and adjust some sizes. The sizes of the GUI components on the left panel will generally remain consistent and shrink to the smallest size possible, so you shouldn't have to adjust that. The plot is where things appear to be oversized on your screen. If you want to adjust this, change the following lines in eyecheck.py:

Line 260:

self.figure = plt.figure(figsize = (12,6))

This sets the figure size. Currently set to 12, 6 (as a width, then height). You might want to try 10, 5 or 8, 4.

Lines 592-594

ax.set_xlabel(r'$\mathrm{Wavelength\;[\AA]}$', fontsize = 16)
ax.set_ylabel(r'$\mathrm{Normalized\;Flux}$', fontsize = 16)
ax.set_title(r'$\mathrm{Template:\;' + templateName + '}$\n$\mathrm{Spectrum:\;' + spectraName.replace('_','\_') + '}$', fontsize = 16)

The default font size of the axis and title is set here to 16. Try changing this to 12 or 10.

If the axis labels and plot title are off the edge of the plot window (especially after you adjust things), you can try playing with the spacing on Line 621.

 plt.subplots_adjust(left = 0.075, right = 0.975, top = 0.9, bottom = 0.15)

This just adds padding around the plot. Increase or decrease as desired.

The settings we chose were set to look the best on a wide variety of monitors and setups, but obviously we can't fit everything perfectly. Hopefully adjusting these will allow you to achieve the desired size and resolution. Good Luck!

zephyr5050 commented 6 years ago

In the mean time, I'm going to close this as not an issue since this is beyond the control of our program. The issue will still exist so if anyone else runs into this in the future, hopefully what I've documented above will be sufficient. I've also added this to the FAQ on the wiki.

JosephKarpinski commented 6 years ago

Thank you! I’ll give it a try.

Sent from my iPhone

On Oct 13, 2018, at 5:29 PM, zephyr5050 notifications@github.com<mailto:notifications@github.com> wrote:

This issue is purely a function of your computer and its resolution and settings. The best I can tell you is to go into the code itself and adjust some sizes. The sizes of the GUI components on the left panel will generally remain consistent and shrink to the smallest size possible, so you shouldn't have to adjust that. The plot is where things appear to be oversized on your screen. If you want to adjust this, change the following lines in eyecheck.py:

Line 260https://github.com/BU-hammerTeam/PyHammer/blob/Developer-Branch/eyecheck.py#L260:

self.figure = plt.figure(figsize = (12,6))

This sets the figure size. Currently set to 12, 6 (as a width, then height). You might want to try 10, 5 or 8, 4.

Lines 592-594https://github.com/BU-hammerTeam/PyHammer/blob/Developer-Branch/eyecheck.py#L592

ax.set_xlabel(r'$\mathrm{Wavelength\;[\AA]}$', fontsize = 16) ax.set_ylabel(r'$\mathrm{Normalized\;Flux}$', fontsize = 16) ax.settitle(r'$\mathrm{Template:\;' + templateName + '}$\n$\mathrm{Spectrum:\;' + spectraName.replace('','_') + '}$', fontsize = 16)

The default font size of the axis and title is set here to 16. Try changing this to 12 or 10.

If the axis labels and plot title are off the edge of the plot window (especially after you adjust things), you can try playing with the spacing on Line 621https://github.com/BU-hammerTeam/PyHammer/blob/Developer-Branch/eyecheck.py#L621.

plt.subplots_adjust(left = 0.075, right = 0.975, top = 0.9, bottom = 0.15)

This just adds padding around the plot. Increase or decrease as desired.

The settings we chose were set to look the best on a wide variety of monitors and setups, but obviously we can't fit everything perfectly. Hopefully adjusting these will allow you to achieve the desired size and resolution. Good Luck!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/BU-hammerTeam/PyHammer/issues/33#issuecomment-429576754, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjZ2IB-r3uQ6G-HwO_fOPECdkO-4eAqTks5uklsxgaJpZM4Xas22.

JosephKarpinski commented 6 years ago

Got it!

Select ‘Configure Subplots’ > Tight layout

How do I make the setting permanent?

Sent from my iPad

On Oct 13, 2018, at 5:42 PM, zephyr5050 notifications@github.com<mailto:notifications@github.com> wrote:

In the mean time, I'm going to close this as not an issue since this is beyond the control of our program. The issue will still exist so if anyone else runs into this in the future, hopefully what I've documented above will be sufficient. I've also added this to the FAQ on the wikihttps://github.com/BU-hammerTeam/PyHammer/wiki/FAQ.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/BU-hammerTeam/PyHammer/issues/33#issuecomment-429577597, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjZ2IH73i2MuXwQ9wNe_9w9h_rBDv2OQks5ukl5WgaJpZM4Xas22.

JosephKarpinski commented 6 years ago

Eyecheck Line 621

plot.subplots_adjust (left = 0.084, right = 0.949, top = 0.849, bottom = 0.159)

Fixed the display problem

Sent from my iPad

On Oct 13, 2018, at 5:42 PM, zephyr5050 notifications@github.com<mailto:notifications@github.com> wrote:

In the mean time, I'm going to close this as not an issue since this is beyond the control of our program. The issue will still exist so if anyone else runs into this in the future, hopefully what I've documented above will be sufficient. I've also added this to the FAQ on the wikihttps://github.com/BU-hammerTeam/PyHammer/wiki/FAQ.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/BU-hammerTeam/PyHammer/issues/33#issuecomment-429577597, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AjZ2IH73i2MuXwQ9wNe_9w9h_rBDv2OQks5ukl5WgaJpZM4Xas22.