Tutorial: Plotting projected density of states with colormap scaling
In this tutorial for SrTiO3, we show how to upload DOS files, select orbital projections, and visualize projected DOS using continuous colormap encoding.
Upload DOS files and parse #
The first step is to upload the required files from your DFT simulation. The upload panel indicates which files can be provided. In this section, you are also asked to provide the Fermi energy. If the Fermi energy is given, the plot will automatically shift the energies so that the Fermi level is set to zero.
After selecting files, click Parse to load the data.
Review generated DOS report cards #
After parsing, the page generates report cards that summarize key results. You can expect values such as bandgap, material type, Fermi value, lattice parameters, angles, volume, and density. If the simulation is spin-polarized and the bandgaps differ between channels, the reports include values for each spin channel.
If you want this report in different units, use the Units panel in the right sidebar.
Step 2: Limits #
Limits
Click Plot to generate a baseline figure, then refine the view with Limits in the right sidebar.
In DOS, this panel controls both energy and DOS-state windows. When you set energy limits, DOS-state limits update automatically to the selected energy window.
Navigation
Use the zoom sliders to focus on selected energy and DOS ranges. Drag slider handles to zoom in or out, and move the selected window to inspect different regions of the projected curves.
Step 3: Add filters and choose colormap controls #
Click Add Filter to create a projection trace. Then select the ion/orbital contributions you want to show in the projection table.
In the filter card, set coloring mode to Colormap, choose a colormap (for example viridis), and tune vmin/vmax to control how projection weights map to color intensity.
It is always a good idea to check your generated figure and colorbar for color blindness accessibility. You can download a PNG and upload it to a simulator such as Coblis Color Blindness Simulator.
The colormap dropdown is searchable, so you can quickly find maps by name. For examples and guidance, see the Matplotlib colormap reference: Matplotlib Colormaps. If you want the opposite gradient direction, enable the Reverse checkbox.
In the filter Coloring panel, Opacity controls transparency
(0 = fully transparent, 1 = fully opaque). Plotting order (z-order)
controls which filters are drawn on top when they overlap: higher values are rendered above lower
values, while auto lets the app choose the order.
In the Values/Spins panel, the Normalize checkbox only rescales projected intensities for plotting; it is not quantum-mechanical normalization. The values depend on the selected projection basis and projection-sphere radii used in the simulation. With Auto enabled, vmin and vmax are set from the minimum and maximum projection values found in the selected input data. If the calculation is spin-polarized, this panel also shows Spin Up and Spin Down checkboxes, which you can use to include either channel alone or both channels in that filter.
Step 4: Example projection for SrTiO3 #
In this example, we use one filter, the p orbital of the Oxygen atoms. For colormap, we use
viridis.
Legend labels can be entered manually, or you can leave them blank and use auto-generated labels based on the selected ions/orbitals.
After adjusting the selected filters click on plot to generate the projected DOS figure.
Step 5: Show and tune legend and colorbar settings #
The legend tile inside each filter card still controls per-filter legend styling, including label text, color, weight, and style. If you leave the label empty, DFT Hub can auto-generate the label from the selected projection.
The Color bar panel in the right sidebar controls global colorbar settings,
including position and layout options such as loc X. and loc Y..
In the Color bar panel, Bar settings control placement and size
(Loc. X, Loc. Y, orientation, length, width, and gap), while
Text settings control readability (label font style, numeric precision, and text gap).
There are two color bar modes you can use in the figure: calculable and non-calculable. The calculable mode is useful for interactive analysis in the web app, while the non-calculable mode is often preferred for publication-ready figures. When Calculable is enabled, you can include or exclude DOS projections above or below a threshold by dragging the color bar edges.
You can select different preset arrangements for color bar placement. The web app can automatically
choose both the bar length and location. If you switch to a custom position, the Loc X. and
Loc Y. fields become active and are prefilled from the latest automatically generated values.
To enable border, tick, and value display settings, uncheck the Calculable checkbox.
Step 6: Customization and styling #
For axis, legend, font, colors, and other appearance controls, use the right sidebar and see the full settings reference in Plot Settings.
Step 7: Export the figure #
When your figure is ready, click the download button in the chart toolbar to export it. Use this to save a clean image for reports, slides, or publications.