Comments (8)
Could you create your own fork and then apply your changes to that? This would make it a lot easier for others to see what exactly you changed and where. See http://help.github.com/fork-a-repo/ for help.
from matlab2tikz.
Hi burkart,
I tried to commit to my branch. My Fork commit is: bfa3ae2
shall I push it to the main repository?
from matlab2tikz.
Hi Tobias,
you wouldn't be able to push to master, but send a pull request.
Anyways, I just looked at the commit, and I gotta say I wouldn't wanna pull it this way. Obviously MATLAB(R) does something here which nobody understands (why oh WHY don't they interpret tick labels as "TeX"?), but it's up to us to fix this. After all, if somebody would want to have the label "\pi" (backslash-p-i), we have to support this (and we currently do).
Now, obviously this is not the best situation. Maybe we could introduce another options "interpretTickLabelsAsTex", have it false by default, and insert something like
if interpretTickLabelsAsTex
labelInterpreter = 'tex';
else
labelInterpreter = 'none';
That'd do away with the cellstrings too.
What do you think?
from matlab2tikz.
I introduced the new option in my build 34f0384. Sadly I had to stick to the cell stuff. I wasn't able to figure out how to get it working without even if you have i.e. a cell formatted xTickLabel list and a cnoncell formatted y-axis...
I hope to be compliant to the overall programming style ;)
from matlab2tikz.
I'm not too sure about the cell strings as I rarely use them, but shouldn't it be
xTickLabel{k} = prettyPrint( m2t, xTickLabel{k}, labelInterpreter);
that is, use curly braces instead of parentheses around the `k'?
As for the general question, I personally tend to think that the output of matlab2tikz should try to replicate that of the same figure in MATLAB as closely as possible. So if MATLAB doesn't support it (see http://www.mathworks.com/help/techdoc/ref/axes_props.html#XTickLabel) maybe m2t shouldn't, either. They actually propose to use TEXT objects instead (see http://www.mathworks.com/support/solutions/en/data/1-5HAF0I/index.html?solution=1-5HAF0I). I haven't tried that out, though.
Since that workaround is quite clumsy, though, I do like the introduction of the new `interpretTickLabelsAsTeX' option, especially as it's quite unintrusive.
from matlab2tikz.
The curly barces are not neccessary in matlab as long as you stick completely to cell type variables. Actually I'm not sure about octave.
In principle I'm with you on the idea to do a conversion "as close as possible". Even the fact that you get something other plotted than you get after latexIng the result...
nevertheless this new option offers quite better usability I think.
BTW thanks for your support!
from matlab2tikz.
I understand the cellstr problem now, and again, it's a MATLAB(R) weirdness.
a = { 'a'; 'b'; 'c' };
a(1) % return 'a'
a(1) = 'z'; % FAIL
a{1} = 'z'; % success
We can't always use curly brackets though as sometimes, the tick labels are just an array (e.g., when it's only numbers).
Why don't we have that problem for interpreter=='none'? Apparently, in this case, prettyPrint returns always returns a cell for which is all works fine. I'll investigate.
from matlab2tikz.
Okay, there was a bit of a mess in the handling of strings vs. cellstrings. prettyPrint() would sometimes return the one, sometimes the other.
I committed a cleanup of that (prettyPrint() now always returns a proper string), and added cell-brackets {} around the function call where necessary (ticks handling). Should work now, please test.
from matlab2tikz.
Related Issues (20)
- matlab2tikz generates empty tikz-file when creating polarplot
- matlab2tikz generates empty tikz-file when creating polarplot HOT 1
- xticklabel style: number format error
- Text from legendflex has vertical position offset HOT 3
- Can matlab2tikz convert bubblecharts to tikz? HOT 1
- workaround for warning "unknown legend location 'layout'" in tiledlayout
- GDX init failed: Could not load shared library libgdxdclib64.dylib: dlopen(libgdxdclib64.dylib, 2): image not found HOT 1
- Error in `formatPgfTickLabels` with loglog plots HOT 1
- matlab2tikz does not know how to handle object with type "implicitfunctionline"
- Error when using bodeplot HOT 1
- Support for sgtitle
- How to simulate audio signal using Uniform Linear Array using MATLAB HOT 1
- Diseño del cerpentin
- add support for plotting polygons? HOT 2
- minor grid style
- Append font style for axis labels
- Spikes in the Latex plot when using Cleanfigure HOT 2
- question about data out of the xlim or ylim
- IMD Grid Finding
- matlab HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matlab2tikz.