matlab2tikz를 사용한 3D 그래프의 축 정렬

matlab2tikz를 사용한 3D 그래프의 축 정렬

Matlab에서 생성된 여러 3D 그림을 라텍스 파일에 포함시키려고 합니다.

MATLAB의 원래 3D 수치는 다음과 같습니다.

여기에 이미지 설명을 입력하세요

이 그림을 생성하는 .m 파일에서 나는 다음을 사용합니다.

ylabel('transformed W_t/D_t','VerticalAlignment','bottom')   
xlabel('\lambda_t','VerticalAlignment','bottom')

xlabel과 ylabel을 위로 이동합니다.

그런 다음 사용합니다.

 matlab2tikz('figure2a_2.tikz', 'height', '\figureheight', 'width', '\figurewidth','extraAxisOptions','zticklabel style={/pgf/number format/fixed}')

파일을 .tikz 파일로 변환합니다.

라텍스에서는

\documentclass[11pt]{article}
\usepackage{pgfplots, pgfplotstable}
\begin{document}
\begin{figure}[!htb]
\centering 
\newlength\figureheight 
\newlength\figurewidth 
\setlength\figureheight{5cm} 
\setlength\figurewidth{6cm}  
\input{Figure2a_2.tikz}
 \caption{{\bf Structure of model: capital can be invested in a bank sector and an equity sector.} An intermediary has the expertise to reallocate capital between the sectors and to monitor bank capital against bank crashes.}
\label{fig1} 
\end{figure}
\end{document}

다음 수치를 얻습니다. 여기에 이미지 설명을 입력하세요

문제는 이제 xlabel과 ylabel이 3D 플롯에서 너무 멀리 떨어져 있기 때문에 조금 위로 이동하고 싶다는 것입니다. 이것이 가능합니까? 명령 에 전달할 옵션 값이 있습니까 matlab2tikz? 아니면 pgfplots.tex 파일에 대한 전역 사양을 작성하시겠습니까?

몇 시간 동안 이 문제를 해결하려고 노력했지만 아무것도 작동하지 않습니다. 도움을 주셔서 감사합니다!

tikzpicture참고: 원본 데이터 파일에는 많은 조작이 필요하고 MATLAB에서 수행하는 것을 선호하기 때문에 라텍스를 사용하여 직접 플롯을 수행할 수 없습니다 .

답변1

나는 간단히 다음을 사용하여 이것을 알아냈습니다.

 matlab2tikz('figure2a_2.tikz', 'height', '\figureheight', 'width', '\figurewidth','extraAxisOptions','zticklabel style={/pgf/number format/fixed},ylabel style={yshift=0.9em}');

전환을 위해

\pgfplotsset{scaled z ticks=false}

.tex 파일 설정에서. 감사해요.

관련 정보