Hi Neal, what you seem to want is something related to the 'symbolic x coords' feature. That feature would expect input *coordinates* of the form (aaa,20) and would automatically map them to numbers - and backwards. The advantage is: pgfplots takes care of assigning suitable tick positions (based on the numeric coordinates, their range, and the size of the image).
In your case, you have numeric input and want textual labels - and it seems as if you have some kind of integer-based tick label scheme. Perhaps you can create a 'x coord inv trafo' *without* a 'x coord trafo' -- and use the same code as for symbolic coordinates? This would allow you to 1. use your tick-label-dictionary index->text 2. keep your numeric input data 3. benefit from automatic tick label generation (to some extend at least). The code for 'symbolic x coords' is in pgfplots.code.tex; I believe it could be copy-pasted and adjusted (perhaps simply by uncommenting the definition of 'x coord trafo'). Would that be a good approach? Best regards Christian Am 19.08.2012 15:28, schrieb Neal H. Walfield: > Hi, > > I'd like pgfplots to determine what tick labels to display, but I'd > like to control what text is shown. Consider the following example: > > \documentclass{article} > > \usepackage{pgfplots} > > \begin{document} > > \begin{tikzpicture} > \begin{axis}[xtick={1,2,3,4,5,6,7,8,9,10}, > xticklabels={aaa,bbb,ccc,ddd,eee,fff,ggg,hhh,iii,jjj}, > width=0.3\textwidth] > \addplot[domain=1:10] {x}; > \end{axis} > \end{tikzpicture} > > \end{document} > > pgfplots displays labels for all of the specified ticks. This results > in unreadable text due to the amount of overlap. > > My plots are actually generated by a program. So I can easily provide > a lot of labels, but it is hard to determine the right set of ticks to > provide. > > Any thoughts on how to accomplish this? > > > Thanks, > > Neal > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Pgfplots-features mailing list > Pgfplots-features@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pgfplots-features ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Pgfplots-features mailing list Pgfplots-features@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pgfplots-features