Skip to content

Commit

Permalink
Merge pull request #428 from rjordans/Development
Browse files Browse the repository at this point in the history
Some minor fixes in plotting
  • Loading branch information
zarath committed Sep 20, 2021
2 parents 0cee90b + 01c58b8 commit cced02e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions NanoVNASaver/Charts/Capacitance.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
class CapacitanceChart(FrequencyChart):
def __init__(self, name=""):
super().__init__(name)
self.leftMargin = 30
self.leftMargin = 45
self.dim.width = 250
self.dim.height = 250
self.minDisplayValue = 0
Expand Down Expand Up @@ -121,7 +121,7 @@ def drawValues(self, qp: QtGui.QPainter):
self.span = span

target_ticks = math.floor(self.dim.height / 60)
fmt = Format(max_nr_digits=1)
fmt = Format(max_nr_digits=3)
for i in range(target_ticks):
val = minValue + (i / target_ticks) * span
try:
Expand Down Expand Up @@ -258,7 +258,7 @@ def drawValues(self, qp: QtGui.QPainter):
self.span = span

target_ticks = math.floor(self.dim.height / 60)
fmt = Format(max_nr_digits=1)
fmt = Format(max_nr_digits=3)
for i in range(target_ticks):
val = minValue + (i / target_ticks) * span
y = self.topMargin + round((self.maxValue - val) / self.span * self.dim.height)
Expand Down
4 changes: 2 additions & 2 deletions NanoVNASaver/Charts/Inductance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
class InductanceChart(FrequencyChart):
def __init__(self, name=""):
super().__init__(name)
self.leftMargin = 30
self.leftMargin = 45
self.dim.width = 250
self.dim.height = 250
self.minDisplayValue = 0
Expand Down Expand Up @@ -120,7 +120,7 @@ def drawValues(self, qp: QtGui.QPainter):
self.span = span

target_ticks = math.floor(self.dim.height / 60)
fmt = Format(max_nr_digits=1)
fmt = Format(max_nr_digits=3)
for i in range(target_ticks):
val = minValue + (i / target_ticks) * span
y = self.topMargin + round((self.maxValue - val) / self.span * self.dim.height)
Expand Down
2 changes: 1 addition & 1 deletion NanoVNASaver/Charts/RI.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def drawValues(self, qp: QtGui.QPainter):
# We want one horizontal tick per 50 pixels, at most
horizontal_ticks = math.floor(self.dim.height/50)

fmt = Format(max_nr_digits=4)
fmt = Format(max_nr_digits=3)
for i in range(horizontal_ticks):
y = self.topMargin + round(i * self.dim.height / horizontal_ticks)
qp.setPen(QtGui.QPen(Chart.color.foreground))
Expand Down

0 comments on commit cced02e

Please sign in to comment.