Matlab PlotPub绘图工具箱

简介

PlotPub 是一个免费和开放源的MATLAB绘图库,用于生成MATLAB漂亮的,出版质量的图。从名字可以看出,该工具包主要是plot绘制一些曲线。

下载安装

下载:https://github.com/masumhabib/PlotPub
安装:addpath('D:/MATLAB/PlotPub-master/lib');解压后将路径添加到Matlab的环境中即可。
去除路径

rmpath('D:/MATLAB/PlotPub-master/lib');

例子

官方例子:https://github.com/masumhabib/PlotPub

clear all; close all; clc

%% lets plot 3 cycles of 50Hz AC voltage
f = 50;  % frequency
Vm = 10; % peak
phi = 0; % phase

% generate the signal
t = [0:0.0001:3/f];
th = 2*pi*f*t;
v = Vm*sin(th+phi);

% plot it
figure;
plot(t*1E3, v);

% change settings
plt = Plot(); % create a Plot object and grab the current figure

plt.XLabel = 'Time, t (ms)'; % xlabel
plt.YLabel = 'Voltage, V (V)'; %ylabel
plt.Title = 'Voltage as a function of time'; % plot title

% Save? comment the following line if you do not want to save
% plt.export('plotSimple1.png');

% plot it
figure;
plot(t*1E3, v);

plt = Plot(t*1E3, v); % create the figure directly using data

plt.XLabel = 'Time, t (ms)'; % xlabel
plt.YLabel = 'Voltage, V (V)'; %ylabel
plt.Title = 'Voltage as a function of time'; % plot title

plt.Colors = {[0, 0, 0]};   % [red, green, blue]
plt.LineWidth = 2;        % line width
plt.LineStyle = {'--'};   % line style: '-', ':', '--' etc

plt.YScale = 'log';     % 'linear' or 'log'
plt.YLim = [1E-3, 1E3]; % [min, max]
plt.YTick = [1E-3, 1E-1, 1E1, 1E3]; %[tick1, tick2, .. ]
plt.YGrid = 'on';       % 'on' or 'off'

在这里插入图片描述

总结

该包比较小,使用也比较简单,功能比较单一,不过对于plot进行了很好的封装,便于绘制plot图。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值