At 3.20.2 I am unable to manually adjust the raster histogram minimum and maximum X-values, as shown in the screen shot below.

There are fill-in boxes (within the red graphic box) which lead me to believe that a manual adjustment is possible. However, changing those values does not change the histogram image.

Changing the options in the Prefs/Actions dropdown has no effect, either.

In summary, I want to control the numeric spread of the X-axis by manually setting the lower and upper values. In the screenshot below, I would like to leave the lower value unchanged, while increasing the maximum value to +0.20.

EDIT: Why do I need to do this?

I have 12 rasters (covering the same spatial extent), each depicting NDVI at a separate time. Because NDVI changes with the growing season, the resulting 12 histograms have differing min-X and max-X values. I need to sequentially display the histograms, and it would really help the viewer interpret those histograms if they all displayed the same min-X and max-X range.

I have determined the absolute min value and max value for all 12 rasters, which I would use for all the histograms.


How to manually set the max/min X-values for QGIS raster histograms?

enter image description here


Babel's answer was correct. For posterity, here are the steps that worked for me at 3.20.3:

Original histogram:

I want to change the default min/max values within the red box.

enter image description here


Click the Prefs/Actions button and make sure the Zoom to Min/Max and Update Style to Min/Max options are checked on. Click the Reset button (1), which clears the min/max boxes (2).

enter image description here

Type in the new Min/Max values. Important: Don't press the Enter button after typing the new values. I used the Tab button after entering each value. Voila! The histogram is updated with the new Min/Max values.

enter image description here


2 Answers 2


Click Prefs/Actions, then activate Zoom to min/max:

enter image description here


By default, bands are stretched to Min/Max. You can adjust this from the symbology tab.

Band Rendering Options in QGIS

If you leave the render type in Singleband Gray, you can simply input your desired Min/Max values and update the settings to User Defined. You also have the option to do a singleband pseudocolor, where you are also able to define the number of classes, the breakpoints (including stretching), and the color ramps.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.