---
name: "im_histplot"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_histplot"
---

# im\_histplot(3)

graph an image of one horizontal or vertical line

## NAME

im\_histplot - graph an image of one horizontal or vertical line

## SYNOPSIS

\#include \<vips/vips.h\>

int im\_histplot(in, out)\
 IMAGE \*in, \*out;

## DESCRIPTION

**[im\_histplot(3)](/im_histplot/3.md)** plots a graph of a horizontal or vertical image file with one line. It is suitable for displaying the output of histogram functions such as [im\_histgr(3)](/im_histgr/3.md) and for displaying line profiles.

Note that if you try to directly plot the result of  **[im\_histgr(3)](/im_histgr/3.md)** you will often get a very, very large image, since **[im\_histplot(3)](/im_histplot/3.md)** will draw an image as high (or as wide) as the largest pixel value in the image (potentially huge). Use **[im\_histnorm(3)](/im_histnorm/3.md)** to normalise the histogram maximum before plotting.

The input image should be either one horizontal line (Ysize=1) or one vertical line (Xsize=1).  If the image is FMTUCHAR, the graph is drawn  as 256 by line-length pixels. For all other unsigned integer types,  **[im\_histplot(3)](/im_histplot/3.md)** finds the image maximum, and draws the graph as max by line-length pixels.

For signed integer types,  **[im\_histplot(3)](/im_histplot/3.md)** finds minimum and maximum, moves min up to zero, and  draws the graph as min + max by line-lenth pixels.

For float types,  **[im\_histplot(3)](/im_histplot/3.md)** finds minimum and maximum, and scales the image range so as to make  the graph square.

## RETURNED VALUE

The function returns 0 on success and -1 on error.

## SEE ALSO

[im\_histgr(3)](/im_histgr/3.md), [im\_histnorm(3)](/im_histnorm/3.md), [im\_extract(3)](/im_extract/3.md).

## COPYRIGHT

National Gallery and Birkbeck College, 1995
