MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _export_values

Method _export_values

lib/matplotlib/backends/backend_qt.py:1030–1049  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1028 self._reset() # Set spinbox current values without triggering signals.
1029
1030 def _export_values(self):
1031 # Explicitly round to 3 decimals (which is also the spinbox precision)
1032 # to avoid numbers of the form 0.100...001.
1033 self._export_values_dialog = QtWidgets.QDialog()
1034 layout = QtWidgets.QVBoxLayout()
1035 self._export_values_dialog.setLayout(layout)
1036 text = QtWidgets.QPlainTextEdit()
1037 text.setReadOnly(True)
1038 layout.addWidget(text)
1039 text.setPlainText(
1040 ",\n".join(f"{attr}={spinbox.value():.3}"
1041 for attr, spinbox in self._spinboxes.items()))
1042 # Adjust the height of the text widget to fit the whole text, plus
1043 # some padding.
1044 size = text.maximumSize()
1045 size.setHeight(
1046 QtGui.QFontMetrics(text.document().defaultFont())
1047 .size(0, text.toPlainText()).height() + 20)
1048 text.setMaximumSize(size)
1049 self._export_values_dialog.show()
1050
1051 def _on_value_changed(self):
1052 spinboxes = self._spinboxes

Callers

nothing calls this directly

Calls 6

joinMethod · 0.80
heightMethod · 0.80
sizeMethod · 0.80
defaultFontMethod · 0.80
valueMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected