image thumbnail

surf to LaTeX

by

 

27 Nov 2006 (Updated )

Converts a displayed surface plot to LaTeX .tex format

nov26_2006_test_surf2latex.m
%% Identification
% David Krause
% Queen's University
% November 26, 2006
% Test surf2latex

opengl neverselect

%% Clean up!
close all
clear all
clc

%% Data to plot
x = (-9 : 1 : 9) * 1e-5;
y = -8 : 1 : 8;

[X, Y] = meshgrid(x, y);

Z = 5 - (X / 1e-5) .^ 2 - Y .^ 2;

surf(x, y, Z);
xlabel('x');
ylabel('y');
zlabel('\rotatebox{90}{z}');

set(gca, 'View', [135.5 32])



st.filename = 'test_figure.tex';
st.comments = 'Test the surf2latex function';
st.x_tick_length = 2;
st.x_tick_width = 0.25;
st.y_tick_length = 2;
st.y_tick_width = 0.25;
st.z_tick_length = 2;
st.z_tick_width = 0.25;
st.figure_box = [25, 15, 100, 90]; % In mm, the size of the plot area (not including the labels)
st.figure_mid = 0.2;
st.plot_line_width = 0.15;

surf2latex(1, st, [], []);

Contact us