Pyqt QCustomPlot 简介、安装与实用代码示例(二)

目录

  • 前言
  • 实用代码示例
    • 彩色图演示
    • 散点像素图演示
    • 实时数据演示
    • 多轴演示
    • 对数轴演示
  • 结语

所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 nixgnauhcuy’s blog!

如需转载,请标明出处!

完整代码我已经上传到 Github 上了,可前往 https://github.com/nixgnauhcuy/QCustomPlot_Pyqt_Study 获取。
完整文章路径:

  • Pyqt QCustomPlot 简介、安装与实用代码示例(一) | nixgnauhcuy
  • Pyqt QCustomPlot 简介、安装与实用代码示例(二) | nixgnauhcuy
  • Pyqt QCustomPlot 简介、安装与实用代码示例(三) | nixgnauhcuy
  • Pyqt QCustomPlot 简介、安装与实用代码示例(四) | nixgnauhcuy

前言

继上文,继续补充官方示例 demo 实现~

实用代码示例

彩色图演示

A 2D color map with color scale. Color scales can be dragged and zoomed just like axes

import sys, mathfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from QCustomPlot_PyQt5 import QCustomPlot, QCPAxis, QCPColorScale, QCPColorMap
from QCustomPlot_PyQt5 import QCPColorGradient, QCPMarginGroup, QCP, QCPRangeclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("彩色地图演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)# configure axis rect:self.customPlot.setInteractions(QCP.Interactions(QCP.iRangeDrag | QCP.iRangeZoom)) # this will also allow rescaling the color scale by dragging/zoomingself.customPlot.axisRect().setupFullAxesBox(True)self.customPlot.xAxis.setLabel("x")self.customPlot.yAxis.setLabel("y")# set up the QCPColorMap:self.colorMap = QCPColorMap(self.customPlot.xAxis, self.customPlot.yAxis)nx = 200ny = 200self.colorMap.data().setSize(nx, ny) # we want the color map to have nx * ny data pointsself.colorMap.data().setRange(QCPRange(-4, 4), QCPRange(-4, 4)) # and span the coordinate range -4..4 in both key (x) and value (y) dimensions# now we assign some data, by accessing the QCPColorMapData instance of the color map:x, y, z = 0, 0, 0for xIndex in range(nx):for yIndex in range(ny):x, y =self.colorMap.data().cellToCoord(xIndex, yIndex)r = 3*math.sqrt(x*x+y*y)+1e-2z = 2*x*(math.cos(r+2)/r-math.sin(r+2)/r) # the B field strength of dipole radiation (modulo physical constants)self.colorMap.data().setCell(xIndex, yIndex, z)# add a color scale:self.colorScale = QCPColorScale(self.customPlot)self.customPlot.plotLayout().addElement(0, 1, self.colorScale) # add it to the right of the main axis rectself.colorScale.setType(QCPAxis.atRight) # scale shall be vertical bar with tick/axis labels right (actually atRight is already the default)self.colorMap.setColorScale(self.colorScale) # associate the color map with the color scaleself.colorScale.axis().setLabel("Magnetic Field Strength")# set the color gradient of the color map to one of the presets:self.colorMap.setGradient(QCPColorGradient(QCPColorGradient.gpPolar))# we could have also created a QCPColorGradient instance and added own colors to# the gradient, see the documentation of QCPColorGradient for what's possible.self.colorMap.rescaleDataRange() # make sure the axis rect and color scale synchronize their bottom and top margins (so they line up):marginGroup = QCPMarginGroup(self.customPlot)self.customPlot.axisRect().setMarginGroup(QCP.msBottom|QCP.msTop, marginGroup)self.colorScale.setMarginGroup(QCP.msBottom|QCP.msTop, marginGroup)# rescale the key (x) and value (y) axes so the whole color map is visible:self.customPlot.rescaleAxes()if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

散点像素图演示

Pixmap scatter points and a multi-lined axis label, as well as a plot title at the top

import sysfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor, QFont, QBrush, QPixmap
from PyQt5.QtCore import Qtfrom QCustomPlot_PyQt5 import QCustomPlot, QCPTextElement, QCPScatterStyle, QCPGraphclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("散点像素图演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.axisRect().setBackground(QColor(0, 0, 0))self.customPlot.addGraph()self.customPlot.graph().setLineStyle(QCPGraph.lsLine)pen = QPen(QColor(255, 200, 20, 200))pen.setStyle(Qt.DashLine)pen.setWidthF(2.5)self.customPlot.graph().setPen(pen)self.customPlot.graph().setBrush(QBrush(QColor(255,200,20,70)))self.customPlot.graph().setScatterStyle(QCPScatterStyle(QPixmap("./tmp.png")))# set graph name, will show up in legend next to icon:self.customPlot.graph().setName("Data from Photovoltaic\nenergy barometer 2011")# set data:year = [2005, 2006, 2007, 2008, 2009, 2010, 2011]value = [2.17, 3.42, 4.94, 10.38, 15.86, 29.33, 52.1]self.customPlot.graph().setData(year, value)# set title of plot:self.customPlot.plotLayout().insertRow(0)self.customPlot.plotLayout().addElement(0, 0, QCPTextElement(self.customPlot, "Regenerative Energies", QFont("sans", 12, QFont.Bold)))# axis configurations:self.customPlot.xAxis.setLabel("Year")self.customPlot.yAxis.setLabel("Installed Gigawatts of\nphotovoltaic in the European Union")self.customPlot.xAxis2.setVisible(True)self.customPlot.yAxis2.setVisible(True)self.customPlot.xAxis2.setTickLabels(False)self.customPlot.yAxis2.setTickLabels(False)self.customPlot.xAxis2.setTicks(False)self.customPlot.yAxis2.setTicks(False)self.customPlot.xAxis2.setSubTicks(False)self.customPlot.yAxis2.setSubTicks(False)self.customPlot.xAxis.setRange(2004.5, 2011.5)self.customPlot.yAxis.setRange(0, 52)# setup legend:self.customPlot.legend.setFont(QFont(self.font().family(), 7))self.customPlot.legend.setIconSize(50, 20)self.customPlot.legend.setVisible(True)self.customPlot.axisRect().insetLayout().setInsetAlignment(0, Qt.AlignLeft | Qt.AlignTop)if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

官方 demo 的背景图我没有,随便用黑色底了,太阳 logo 也没有,随便找了一个,效果一样就行~

实时数据演示

Real time generated data and time bottom axis

import sys, math, randomfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor
from PyQt5.QtCore import Qt, QTime, QTimerfrom QCustomPlot_PyQt5 import QCustomPlot, QCPAxisTickerTimeclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("实时数据演示")self.resize(600,400)self.lastPointKey = 0self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.addGraph()self.customPlot.graph(0).setPen(QPen(QColor(40, 110, 255)))self.customPlot.addGraph()self.customPlot.graph(1).setPen(QPen(QColor(255, 110, 40)))timeTicker = QCPAxisTickerTime()timeTicker.setTimeFormat("%h:%m:%s")self.customPlot.xAxis.setTicker(timeTicker)self.customPlot.axisRect().setupFullAxesBox()self.customPlot.yAxis.setRange(-1.2, 1.2)# make left and bottom axes transfer their ranges to right and top axes:self.customPlot.xAxis.rangeChanged.connect(self.customPlot.xAxis2.setRange)self.customPlot.yAxis.rangeChanged.connect(self.customPlot.yAxis2.setRange)# setup a timer that repeatedly calls MainWindow::realtimeDataSlot:self.curTime = QTime.currentTime()self.dataTimer = QTimer(self)self.dataTimer.timeout.connect(self.realtimeDataSlot)self.dataTimer.start(0) # Interval 0 means to refresh as fast as possibledef realtimeDataSlot(self) -> None:# calculate two new data points:key = self.curTime.msecsTo(QTime.currentTime())/1000.0if key-self.lastPointKey > 0.002: # at most add point every 2 ms# add data to lines:self.customPlot.graph(0).addData(key, math.sin(key)+random.random()*1*math.sin(key/0.3843))self.customPlot.graph(1).addData(key, math.cos(key)+random.random()*0.5*math.sin(key/0.4364))# rescale value (vertical) axis to fit the current data:# self.customPlot.graph(0).rescaleValueAxis()# self.customPlot.graph(1).rescaleValueAxis(True)self.lastPointKey = key# make key axis range scroll with the data (at a constant range size of 8):self.customPlot.xAxis.setRange(key, 8, Qt.AlignRight)self.customPlot.replot()if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

多轴演示

Multiple plot styles with different key/value axes and pi tick labeling at top axis

import sys, math, randomfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor, QFont, QBrush
from PyQt5.QtCore import Qt, QLocale
from QCustomPlot_PyQt5 import QCustomPlot, QCPGraph, QCPScatterStyle, QCPTextElement, QCPAxisTickerPi, QCPErrorBarsclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("多轴演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.setLocale(QLocale(QLocale.English, QLocale.UnitedKingdom)) # period as decimal separator and comma as thousand separatorself.customPlot.legend.setVisible(True)legendFont = self.font()  # start out with MainWindow's font..legendFont.setPointSize(9) # and make a bit smaller for legendself.customPlot.legend.setFont(legendFont)self.customPlot.legend.setBrush(QBrush(QColor(255,255,255,230)))# by default, the legend is in the inset layout of the main axis rect. So this is how we access it to change legend placement:self.customPlot.axisRect().insetLayout().setInsetAlignment(0, Qt.AlignBottom|Qt.AlignRight)# setup for graph 0: key axis left, value axis bottom# will contain left maxwell-like functionself.customPlot.addGraph(self.customPlot.yAxis, self.customPlot.xAxis)self.customPlot.graph(0).setPen(QPen(QColor(255, 100, 0)))self.customPlot.graph(0).setLineStyle(QCPGraph.lsLine)self.customPlot.graph(0).setScatterStyle(QCPScatterStyle(QCPScatterStyle.ssDisc, 5))self.customPlot.graph(0).setName("Left maxwell function")# setup for graph 1: key axis bottom, value axis left (those are the default axes)# will contain bottom maxwell-like function with error barsself.customPlot.addGraph()self.customPlot.graph(1).setPen(QPen(Qt.red))self.customPlot.graph(1).setLineStyle(QCPGraph.lsStepCenter)self.customPlot.graph(1).setScatterStyle(QCPScatterStyle(QCPScatterStyle.ssCircle, Qt.red, Qt.white, 7))self.customPlot.graph(1).setName("Bottom maxwell function")errorBars = QCPErrorBars(self.customPlot.xAxis, self.customPlot.yAxis)errorBars.removeFromLegend()errorBars.setDataPlottable(self.customPlot.graph(1))# setup for graph 2: key axis top, value axis right# will contain high frequency sine with low frequency beating:self.customPlot.addGraph(self.customPlot.xAxis2, self.customPlot.yAxis2)self.customPlot.graph(2).setPen(QPen(Qt.blue))self.customPlot.graph(2).setName("High frequency sine")# setup for graph 3: same axes as graph 2# will contain low frequency beating envelope of graph 2self.customPlot.addGraph(self.customPlot.xAxis2, self.customPlot.yAxis2)blueDotPen = QPen(QColor(30, 40, 255, 150))blueDotPen.setStyle(Qt.DotLine)blueDotPen.setWidthF(4)self.customPlot.graph(3).setPen(blueDotPen)self.customPlot.graph(3).setName("Sine envelope")# setup for graph 4: key axis right, value axis top# will contain parabolically distributed data points with some random perturbanceself.customPlot.addGraph(self.customPlot.yAxis2, self.customPlot.xAxis2)self.customPlot.graph(4).setPen(QPen(QColor(50, 50, 50, 255)))self.customPlot.graph(4).setLineStyle(QCPGraph.lsNone)self.customPlot.graph(4).setScatterStyle(QCPScatterStyle(QCPScatterStyle.ssCircle, 4))self.customPlot.graph(4).setName("Some random data around\na quadratic function")# generate data, just playing with numbers, not much to learn here:x0 = [3*i/25.0 for i in range(25)]y0 = [math.exp(-x*x*0.8)*(x*x+x) for x in x0]self.customPlot.graph(0).setData(x0, y0)x1 = [3*i/15.0 for i in range(15)]y1 = [math.exp(-x*x)*(x*x)*2.6 for x in x1]y1err = [y*0.25 for y in y1]self.customPlot.graph(1).setData(x1, y1)errorBars.setData(y1err, y1err)x2 = [i/250.0*3*math.pi for i in range(250)]y2 = [math.sin(x*12)*math.cos(x)*10 for x in x2]self.customPlot.graph(2).setData(x2, y2)x3 = x2y3 = [math.cos(x)*10 for x in x3]self.customPlot.graph(3).setData(x3, y3)x4 = [i/250.0*100-50 for i in range(250)]y4 = [0.01*x*x + 1.5*(random.random()-0.5) + 1.5*math.pi for x in x4]self.customPlot.graph(4).setData(x4, y4)# activate top and right axes, which are invisible by default:self.customPlot.xAxis2.setVisible(True)self.customPlot.yAxis2.setVisible(True)# set ranges appropriate to show data:self.customPlot.xAxis.setRange(0, 2.7)self.customPlot.yAxis.setRange(0, 2.6)self.customPlot.xAxis2.setRange(0, 3.0*math.pi)self.customPlot.yAxis2.setRange(-70, 35)# set pi ticks on top axis:self.customPlot.xAxis2.setTicker(QCPAxisTickerPi())# add title layout element:self.customPlot.plotLayout().insertRow(0)self.customPlot.plotLayout().addElement(0, 0, QCPTextElement(self.customPlot, "Way too many graphs in one plot", QFont("sans", 12, QFont.Bold)))# set labels:self.customPlot.xAxis.setLabel("Bottom axis with outward ticks")self.customPlot.yAxis.setLabel("Left axis label")self.customPlot.xAxis2.setLabel("Top axis label")self.customPlot.yAxis2.setLabel("Right axis label")# make ticks on bottom axis go outward:self.customPlot.xAxis.setTickLength(0, 5)self.customPlot.xAxis.setSubTickLength(0, 3)# make ticks on right axis go inward and outward:self.customPlot.yAxis2.setTickLength(3, 3)self.customPlot.yAxis2.setSubTickLength(1, 1)if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

对数轴演示

Logarithmic axis scaling. Note correct display of the sine function crossing zero in negative infinity

import sys, mathfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor, QBrush
from PyQt5.QtCore import Qt
from QCustomPlot_PyQt5 import QCustomPlot, QCPGraph, QCPGraphData, QCP, QCPAxis, QCPAxisTickerLogclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("对数轴演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.setNoAntialiasingOnDrag(True) # more performance/responsiveness during draggingself.customPlot.addGraph()pen = QPen(QColor(255,170,100))pen.setWidth(2)pen.setStyle(Qt.DotLine)self.customPlot.graph(0).setPen(pen)self.customPlot.graph(0).setName("x")self.customPlot.addGraph()self.customPlot.graph(1).setPen(QPen(Qt.red))self.customPlot.graph(1).setBrush(QBrush(QColor(255, 0, 0, 20)))self.customPlot.graph(1).setName("-sin(x)exp(x)")self.customPlot.addGraph()self.customPlot.graph(2).setPen(QPen(Qt.blue))self.customPlot.graph(2).setBrush(QBrush(QColor(0, 0, 255, 20)))self.customPlot.graph(2).setName(" sin(x)exp(x)")self.customPlot.addGraph ()pen = QPen(QColor(0,0,0))pen.setWidth(1)pen.setStyle(Qt.DashLine)self.customPlot.graph(3).setPen(pen)self.customPlot.graph(3).setBrush(QBrush(QColor(0,0,0,15)))self.customPlot.graph(3).setLineStyle(QCPGraph.lsStepCenter)self.customPlot.graph(3).setName("x!")dataCount = 200dataFactorialCount = 21dataLinear = [QCPGraphData() for i in range(dataCount)]dataMinusSinExp = [QCPGraphData() for i in range(dataCount)]dataPlusSinExp = [QCPGraphData() for i in range(dataCount)]dataFactorial = [QCPGraphData() for i in range(dataFactorialCount)]for i in range(dataCount):dataLinear[i].key = i/10.0dataLinear[i].value = dataLinear[i].keydataMinusSinExp[i].key = i/10.0dataMinusSinExp[i].value = -math.sin(dataMinusSinExp[i].key)*math.exp(dataMinusSinExp[i].key)dataPlusSinExp[i].key = i/10.0dataPlusSinExp[i].value = math.sin(dataPlusSinExp[i].key)*math.exp(dataPlusSinExp[i].key)for i in range(dataFactorialCount):dataFactorial[i].key = idataFactorial[i].value = 1.0for k in range(1, i+1):dataFactorial[i].value *= kself.customPlot.graph(0).data().set(dataLinear)self.customPlot.graph(1).data().set(dataMinusSinExp)self.customPlot.graph(2).data().set(dataPlusSinExp)self.customPlot.graph(3).data().set(dataFactorial)self.customPlot.xAxis.grid().setSubGridVisible(True)self.customPlot.yAxis.grid().setSubGridVisible(True)self.customPlot.yAxis.setScaleType(QCPAxis.stLogarithmic)self.customPlot.yAxis2.setScaleType(QCPAxis.stLogarithmic)logTicker = QCPAxisTickerLog()self.customPlot.yAxis.setTicker(logTicker)self.customPlot.yAxis2.setTicker(logTicker)self.customPlot.yAxis.setNumberFormat("eb") # e = exponential, b = beautiful decimal powersself.customPlot.yAxis.setNumberPrecision(0) # makes sure "1*10^4" is displayed only as "10^4"self.customPlot.xAxis.setRange(0, 19.9)self.customPlot.yAxis.setRange(1e-2, 1e10)# make range draggable and zoomable:self.customPlot.setInteractions(QCP.Interactions(QCP.iRangeDrag | QCP.iRangeZoom))# make top right axes clones of bottom left axes:self.customPlot.axisRect().setupFullAxesBox()# connect signals so top and right axes move in sync with bottom and left axes:self.customPlot.xAxis.rangeChanged.connect(self.customPlot.xAxis2.setRange)self.customPlot.yAxis.rangeChanged.connect(self.customPlot.yAxis2.setRange)self.customPlot.legend.setVisible(True)self.customPlot.legend.setBrush(QBrush(QColor(255,255,255,150)))self.customPlot.axisRect().insetLayout().setInsetAlignment(0, Qt.AlignLeft|Qt.AlignTop) # make legend align in top left corner or axis rectif __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

结语

还剩下一些示例,待续篇更新!~

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/355794.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

第 402 场 LeetCode 周赛题解

A 构成整天的下标对数目 I 计数&#xff1a;遍历 h o u r s hours hours &#xff0c;记录 h o u r s [ i ] % 24 hours[i]\%24 hours[i]%24 的出现次数 class Solution {public:long long countCompleteDayPairs(vector<int>& hours) {vector<int> cnt(24);…

【小白专用 已验证24.6.18】C# SqlSugar操作MySQL数据库实现增删改查

【小白专用24.6.18】C# SqlSugar&#xff1a;连接数据库实现简单的&#xff0c;增、删、改、查-CSDN博客 SqlSugar .Net ORM 5.X 官网 、文档、教程 - SqlSugar 5x - .NET果糖网 SqlSugar项目创建 通过NuGet包管理器搜索SqlSugar&#xff08;MySql还要安装MySql.Data、Newton…

如何计算 GPT 的 Tokens 数量?

基本介绍 随着人工智能大模型技术的迅速发展&#xff0c;一种创新的计费模式正在逐渐普及&#xff0c;即以“令牌”&#xff08;Token&#xff09;作为衡量使用成本的单位。那么&#xff0c;究竟什么是Token呢&#xff1f; Token 是一种将自然语言文本转化为计算机可以理解的…

【Linux】进程信号2——阻塞信号,捕捉信号

1.阻塞信号 1.1. 信号其他相关常见概念 在开始内容之前&#xff0c;先介绍一些信号的专业名词&#xff1a; 实际执行信号的处理动作称为信号递达&#xff08;Delivery&#xff09;信号从产生到递达之间的状态&#xff0c;称为信号未决&#xff08;Pending&#xff09;&#…

【秋招刷题打卡】Day01-自定义排序

Day01-自定排序 前言 给大家推荐一下咱们的 陪伴打卡小屋 知识星球啦&#xff0c;详细介绍 >笔试刷题陪伴小屋-打卡赢价值丰厚奖励 < ⏰小屋将在每日上午发放打卡题目&#xff0c;包括&#xff1a; 一道该算法的模版题 (主要以力扣&#xff0c;牛客&#xff0c;acwin…

【Git】 -- Part1 -- 基础操作

1. Git简介 Git 是一个开源的分布式版本控制系统&#xff0c;由 Linus Torvalds 于 2005 年开发&#xff0c;主要用于源代码管理。Git 允许多名开发者共同合作处理同一个项目&#xff0c;跟踪每个文件的修改&#xff0c;并且在必要时回滚到之前的版本。 Linus Torvalds是Linux…

CAC 2.0融合智谱AI大模型,邮件安全新升级

在数字化时代&#xff0c;电子邮件的安全问题日益成为关注的焦点。Coremail CACTER邮件安全人工智能实验室&#xff08;以下简称“CACTER AI实验室”&#xff09;凭借其在邮件安全领域的深入研究与创新实践&#xff0c;不断推动技术进步。 此前&#xff0c;CACTER AI实验室已获…

Python基础教程(二十八):pip模块

&#x1f49d;&#x1f49d;&#x1f49d;首先&#xff0c;欢迎各位来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里不仅可以有所收获&#xff0c;同时也能感受到一份轻松欢乐的氛围&#xff0c;祝你生活愉快&#xff01; &#x1f49d;&#x1f49…

Go语言开发框架GoFly已集成数据可视化大屏开发功能,让开发者只专注业务开发,本文指导大家如何使用

前言 框架提供数据大屏开发基础&#xff0c;是考虑当前市场软件应用有一大部分是需要把业务数据做出大屏&#xff0c;很多政府项目对大屏需求特别高&#xff0c;还有生产企业项目也对大屏有需求&#xff0c;没有提供基础规范的后台框架&#xff0c;在开发大屏需要很多时间去基…

Ubuntu server 24 (Linux) 安装部署samba服务器 共享文件目录 windows访问

1 安装 sudo apt update sudo apt-get install samba #启动服务 sudo systemctl restart smbd.service sudo systemctl enable smbd.service #查看服务 2 创建用户 #创建系统用户 sudo useradd test2 #配置用户密码 sudo smbpasswd -a test2 # smbpasswd: -a添加用户 …

STM32学习笔记(六)--引脚重映射详解

STM32F103C8T6引脚定义&#xff1a; 在STM32微控制器中&#xff0c;外设引脚的复用功能&#xff08;Alternate Function&#xff0c;AF&#xff09;有时会出现冲突&#xff0c;例如当USART2_CTS和TIM2_CH1同时需要使用相同的引脚时。此时&#xff0c;可以通过引脚重映射功能&am…

DS知识点总结--线性表定义及顺序表示

数据结构知识点汇总(考研C版) 文章目录 数据结构知识点汇总(考研C版)二、线性表2.1 线性表的定义和操作2.1.1 线性表的定义2.1.2 线性表的基本操作 2.2 线性表的顺序表示2.2.1 顺序表的定义2.2.2 顺序表上的基本操作的实现 二、线性表 2.1 线性表的定义和操作 2.1.1 线性表的…

python通过selenium实现自动登录及轻松过滑块验证、点选验证码(2024-06-14)

一、chromedriver配置环境搭建 请确保下载的驱动程序与你的Chrome浏览器版本匹配&#xff0c;以确保正常运行。 1、Chrome版本号 chrome的地址栏输入chrome://version&#xff0c;自然就得到125.0.6422.142 版本 125.0.6422.142&#xff08;正式版本&#xff09; &#xff08;…

V4和V6双栈处理

现进行双栈 对R1 对R2 对R3 对R4 路由地址配完&#xff0c;起协议 然后起ripng&#xff0c;在R2&#xff0c;R3&#xff0c;R4上都宣告一下 然后在PC1和PC2上都手动配置一下就可以了

Kafka第一篇——内部组件概念架构启动服务器zookeeper选举以及底层原理

目录 引入 ——为什么分布式系统需要用第三方软件&#xff1f; JMS 对比 组件 架构推演——备份实现安全可靠 &#xff0c; Zookeeper controller的选举 controller和broker底层通信原理 BROKER内部组件 ​编辑 topic创建 引入 ——为什么分布式系统需要用第三方软件&#…

游戏开发丨基于Tkinter的五子棋小游戏

文章目录 写在前面Tkinter五子棋系列文章写在后面 写在前面 本期内容&#xff1a;基于tkinter的五子棋小游戏 下载地址&#xff1a;https://download.csdn.net/download/m0_68111267/88700190 实验环境 python3.11及以上pycharmtkinter Tkinter Tkinter是Python的一个标准…

刷题记录(240613)

aliyun0512 1. 小红定义一个数组是好数组&#xff0c;当且仅当所有奇数出现了奇数次&#xff0c;所有偶数出现了偶数次。现在小红拿到了一个数组&#xff0c;她希望取一个该数组的非空子序列(可以不连续)&#xff0c;使得子序列是好数组。你能帮小红求出子序列的方案数吗?由于…

C# Winform Datagridview控件使用和详解

DataGridView 是一种以表格形式显示数据的控件&#xff0c;由Rows(行)&#xff0c;Columns(列)&#xff0c;Cells(单元格)构成。本实例将综合利用DataGridView的属性和事件&#xff0c;展示不同的表格风格数据和操作。包含&#xff1a; 添加Datagridview行&#xff0c;列数据设…

APP IOS

APP IOS苹果源生应用程序 APP Android-CSDN博客

【Python/Pytorch 】-- K-means聚类算法

文章目录 文章目录 00 写在前面01 基于Python版本的K-means代码02 X-means方法03 最小二乘法简单理解04 贝叶斯信息准则 00 写在前面 时间演变聚类算法&#xff1a;将时间演变聚类算法用在去噪上&#xff0c;基本思想是&#xff0c;具有相似信号演化的体素具有相似的模型参数…