Dracula color theme for figures

Dracula theme function, color codes, and colormap
39 Downloads
Updated 27 Jan 2024

View License

Description
The Dracula color theme is a stylish dark color theme that is very popular in the programming community. With the draculize function you can apply the Dracula color theme to (most) plots generated in MATLAB.
Recommended Usage
The draculize function (and the color palettes in dracula.mat) are highly recommended if you are already using a dark color theme in your MATLAB Desktop App or in MATLAB Online because it will eliminate the bright white background in most of the figures that you make.
Examples
Create a figure and use the draculize function to apply the Dracula color theme
[X,Y,Z] = peaks;
figure(1)
contour3(X,Y,Z,20)
title('3D Contour Plot'), subtitle('Works with subtitles, too.')
xlabel('X-axis'), ylabel('Y-axis'), zlabel('Z-axis')
hold on
text(-3.5,-2.5,-2.5,'...and added text!')
hold off
% Apply the Dracula color theme:
draculize
Alternatively, select colors from the Dracula theme and edit the figure manually
load dracula.mat
% Loads 3 variables containing the Dracula color palette:
% >> dracula_rgb_colors (11x3 double)
% >> dracula_hex_colors (11x1 cell)
% >> dracula_colormap (255x3 double)
figure(2)
x = 0:10;
y = 0:10;
for n = 1:7
plot(x,log(y).*n,...
'o-',...
'LineWidth',2,...
'MarkerFaceColor','auto')
hold on
end
hold off
title('Figure 2')
% Edit figure manually
f=gcf;
ax=gca;
f.Color = dracula_rgb_colors(1,:);
ax.Color = dracula_rgb_colors(1,:);
ax.XColor = dracula_rgb_colors(3,:);
ax.YColor = dracula_rgb_colors(3,:);
ax.Title.Color = dracula_rgb_colors(3,:);
colororder(dracula_rgb_colors(5:end,:)) % Recommend using rows 5:end
This FileExchange submission contains four files:
  • draculize.m --> A function for applying the Dracula color theme to the current figure
  • dracula.mat --> A binary MATLAB file storing the Dracula color codes and color map
  • draculize_example.m --> A script file showing how the draculize function is used
  • dracula_gradient.m --> A script file showing how the Dracula colormap was created

Cite As

Austin M. Weber (2024). Dracula color theme for figures (https://www.mathworks.com/matlabcentral/fileexchange/157951-dracula-color-theme-for-figures), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2023b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0

Updated function compatibility with more plot types; now works on most polar axes charts, 3D charts, and others.

1.0.0