diff --git a/src/main.c b/src/main.c
index 2334735befa07da38418837804d0c927a986ac57..e1a4a0ac69b9d9880c7862c9cd94c24617cedded 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,6 +33,9 @@ struct context {
 
 	GtkWidget* plot;
 
+	char* xaxis;
+	size_t xaxis_n;
+
 	float (* colours)[3];
 	size_t n_colours;
 
@@ -98,8 +101,24 @@ int main( int argc, char** argv ) {
 	fcntl( STDIN_FILENO, F_SETFL,
 		fcntl( STDIN_FILENO, F_GETFL ) | O_NONBLOCK );
 
+	const GOptionEntry options[] = {
+		{
+			.long_name = "x-axis",
+			.short_name = 'x',
+			.flags = G_OPTION_FLAG_NONE,
+			.arg = G_OPTION_ARG_STRING,
+			.arg_data = &( context->xaxis ),
+			.description = "Column to use as the x-axis",
+			.arg_description = "column",
+		}, {
+			NULL,
+		},
+	};
+
 	GtkApplication* app = gtk_application_new(
 		"uk.ac.soton.ecs.e-plot", G_APPLICATION_DEFAULT_FLAGS );
+	g_application_add_main_option_entries(
+		G_APPLICATION( app ), options );
 	g_signal_connect(
 		app, "activate", G_CALLBACK( app_activate ), context );
 
@@ -418,6 +437,8 @@ static void parse_headers( struct context* context ) {
 	c = context->read_buffer;
 	quote = '\0';
 
+	bool found = false;
+
 	while ( '\0' != *c ) {
 
 		header[0] = '\0';
@@ -482,11 +503,26 @@ static void parse_headers( struct context* context ) {
 			stripped_header[strlen( stripped_header ) - 1] = '\0';
 		}
 
-		context->headers[n] = strdup( stripped_header );
-		n++;
+		if ( NULL != context->xaxis &&
+				0 == strcmp( stripped_header, context->xaxis ) ) {
+
+			found = true;
+
+		} else {
+
+			context->headers[n] = strdup( stripped_header );
+			n++;
+
+		}
 
 	}
 
+	if ( !found ) {
+		free( context->xaxis );
+		context->xaxis = NULL;
+		context->xaxis_n = -1;
+	}
+
 }
 
 static void parse_data( struct context* context ) {
@@ -514,6 +550,7 @@ static void parse_data( struct context* context ) {
 	size_t n = 0;
 	char value[strlen( context->read_buffer )];
 	char quote = '\0';
+	bool timed = false;
 
 	while ( '\0' != *c && n < context->n_headers ) {
 
@@ -579,14 +616,31 @@ static void parse_data( struct context* context ) {
 		}
 
 		char* end_ptr = NULL;
-		data->y[n].v = strtod( stripped_value, &end_ptr );
-		if ( '\0' == *end_ptr ) {
-			data->y[n].present = true;
+		double value = strtod( stripped_value, &end_ptr );
+
+		if ( n == context->xaxis_n && !timed ) {
+
+			timed = true;
+			if ( '\0' == *end_ptr ) {
+				data->x = value;
+			} else {
+				free( data );
+				return;
+			}
+
+
 		} else {
-			data->y[n].present = false;
-		}
 
-		n++;
+			if ( '\0' == *end_ptr ) {
+				data->y[n].v = value;
+				data->y[n].present = true;
+			} else {
+				data->y[n].present = false;
+			}
+
+			n++;
+
+		}
 
 	}