Skip to content

Commit

Permalink
fixed formatting of graph titles
Browse files Browse the repository at this point in the history
  • Loading branch information
jkarns275 committed Jun 12, 2018
1 parent 9d92825 commit f564531
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
*hapiest* is a GUI that works with the HITRAN API, enabling access
to all sorts of spectrographic data without knowledge of python.

# How to Install
# Download
Windows x86 Executable [Download](#)

There are no Mac OSX or Linux executables, please make an issue in this repository to request one.

# How to Manually Install
Hapiest currently has no binary packages, but the program itself can be downloaded
with the [install.py](https://github.com/hitranonline/hapiest/blob/master/install.py) script.

*You must have python 3.6 or later to install and use hapiest*.

For windows, mac, or linux, download [install.py](https://raw.githubusercontent.com/hitranonline/hapiest/master/install.py) and run it in the directory you want the hapiest folder to be created.

For mac and linux you can run the following in the terminal, and on windows in the command line:
```bash
wget -O install.py https://raw.githubusercontent.com/hitranonline/hapiest/master/install.py
Expand Down
8 changes: 4 additions & 4 deletions layouts/graph_display_window_v2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
</font>
</property>
<property name="decimals">
<number>8</number>
<number>4</number>
</property>
<property name="maximum">
<double>9007199254740992.000000000000000</double>
Expand Down Expand Up @@ -137,7 +137,7 @@
</font>
</property>
<property name="decimals">
<number>8</number>
<number>4</number>
</property>
<property name="maximum">
<double>9007199254740992.000000000000000</double>
Expand Down Expand Up @@ -215,7 +215,7 @@
</font>
</property>
<property name="decimals">
<number>8</number>
<number>4</number>
</property>
<property name="maximum">
<double>9007199254740992.000000000000000</double>
Expand Down Expand Up @@ -248,7 +248,7 @@
</font>
</property>
<property name="decimals">
<number>8</number>
<number>4</number>
</property>
<property name="maximum">
<double>9007199254740992.000000000000000</double>
Expand Down
12 changes: 8 additions & 4 deletions src/widgets/graph_display_window_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def add_graph(self, x, y, title, xtitle, ytitle, name, args):
for i in range(0, x.size):
series.append(x[i], y[i])
self.series = [series]
series.setName( name + ' -<br>Function: {},<br>T: {} K, P: {} atm<br>γ-air: {}, γ-self: {}'.format(
series.setName( name + ' -<br>Function: {},<br>T: {:.2f} K, P: {:.2f} atm<br>γ-air: {:.2f}, γ-self: {:.2f}'.format(
args['graph_fn'], args['Environment']['T'], args['Environment']['p'],
args['Diluent']['air'], args['Diluent']['self']))

Expand Down Expand Up @@ -113,7 +113,7 @@ def add_graph(self, x, y, title, xtitle, ytitle, name, args):
self.graph_container.setLayout(layout)
else:
series = QLineSeries()
series.setName( name + ' -<br>Function={},<br>T={}, P={}<br>γ-air: {}, γ-self: {}'.format(
series.setName( name + ' -<br>Function={},<br>T={:.2f}, P={L.2f}<br>γ-air: {:.2f}, γ-self: {:.2f}'.format(
args['graph_fn'], args['Environment']['T'], args['Environment']['p'],
args['Diluent']['air'], args['Diluent']['self']))
series.setUseOpenGL(True)
Expand Down Expand Up @@ -248,9 +248,13 @@ def __on_save_as_png_triggered(self, _checked: bool):

filename = self.get_file_save_name('.png', 'PNG files (*.png, *.PNG)')

chart_view = QChartView(self.chart)
geometry = self.chart_view.geometry()
pixmap = QPixmap(16 * geometry.width(), 16 * geometry.height())
painter = QPainter()
pixmap = chart_view.render(painter)

painter.begin(pixmap)
self.chart_view.render(painter)
painter.end()

pixmap.save(filename, 'PNG')

Expand Down

0 comments on commit f564531

Please sign in to comment.