3 examples of 'python colorbar label' in Python

Every line of 'python colorbar label' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
492def _set_label_text(self):
493 """
494 set label.
495 """
496 self.cbar_axis.set_label_text(self._label, **self._labelkw)
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

2220def _colorbar(off=0.0, colors=256, label_name='zlabel'):
2221 global _plt
2222 gr.savestate()
2223 viewport = _plt.kwargs['viewport']
2224 zmin, zmax = _plt.kwargs['zrange']
2225 gr.setwindow(0, 1, zmin, zmax)
2226 gr.setviewport(viewport[1] + 0.02 + off, viewport[1] + 0.05 + off,
2227 viewport[2], viewport[3])
2228
2229 if colors == 1:
2230 data = [1000]
2231 else:
2232 data = [1000 + int(255 * i / (colors - 1)) for i in range(colors)]
2233
2234 gr.setlinecolorind(1)
2235 gr.setscale(0)
2236 if _plt.kwargs['scale'] & gr.OPTION_FLIP_Z:
2237 gr.cellarray(0, 1, zmin, zmax, 1, colors, data)
2238 else:
2239 gr.cellarray(0, 1, zmax, zmin, 1, colors, data)
2240 diag = ((viewport[1] - viewport[0])**2 + (viewport[3] - viewport[2])**2)**0.5
2241 charheight = max(0.016 * diag, 0.012)
2242 gr.setcharheight(charheight)
2243 if _plt.kwargs['scale'] & gr.OPTION_Z_LOG:
2244 if _plt.kwargs['scale'] & gr.OPTION_FLIP_Z:
2245 gr.setscale(gr.OPTION_Y_LOG | gr.OPTION_FLIP_Y)
2246 else:
2247 gr.setscale(gr.OPTION_Y_LOG)
2248 gr.axes(0, 2, 1, zmin, 0, 1, 0.005)
2249 else:
2250 if _plt.kwargs['scale'] & gr.OPTION_FLIP_Z:
2251 gr.setscale(gr.OPTION_FLIP_Y)
2252 else:
2253 gr.setscale(0)
2254 ztick = 0.5 * gr.tick(zmin, zmax)
2255 gr.axes(0, ztick, 1, zmin, 0, 1, 0.005)
2256 label = _plt.kwargs.get(label_name, None)
2257 if label:
2258 diag = ((viewport[1] - viewport[0])**2 + (viewport[3] - viewport[2])**2)**0.5
2259 charheight = max(0.018 * diag, 0.012)
2260 gr.setcharheight(charheight)
2261 gr.settextalign(gr.TEXT_HALIGN_CENTER, gr.TEXT_VALIGN_BASE)
2262 gr.textext(viewport[1] + 0.035 + off, viewport[3] + 0.01, label)
2263 gr.restorestate()
197def set_label(self, text, unit=None):
198 self.cb_plot_widget.setLabel('left', text=text, units=unit)
199 if unit is not None:
200 self.max_spinbox.setSuffix(unit)
201 self.min_spinbox.setSuffix(unit)
202 return

Related snippets