TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I convert the automatic table generated by the macro, to an automatic histogram? Is the best way do it using pgfplots?



% **********************************************************
% **********************************************************

\tl_const:Nx \c_aw_the_alphabet_tl {abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.;?()!' \token_to_str:N :}

\tl_new:N \l_aw_tab_rows_tl
\seq_new:N \g_aw_theor_rats_seq
\seq_new:N \g_aw_the_alphabet_seq

\seq_gset_split:Nnn \g_aw_theor_rats_seq {,}

\NewDocumentCommand {\showtable}{}

\cs_generate_variant:Nn \seq_set_split:Nnn {NnV}
\cs_new:Npn \aw_make_table:
      \seq_set_split:NnV \g_aw_the_alphabet_seq {} \c_aw_the_alphabet_tl
      %takes corresponding letter/theoretical ratio pairs from sequences and applies function
      \seq_mapthread_function:NNN \g_aw_the_alphabet_seq \g_aw_theor_rats_seq \aw_generate_row:nn
        \tl_use:N \l_aw_tab_rows_tl

\cs_new:Npn \aw_generate_row:nn #1#2
      \tl_put_right:Nn \l_aw_tab_rows_tl {#1&}
      \tl_put_right:Nn \l_aw_tab_rows_tl {\fp_eval:n{100*{#2}}\%}
      \tl_put_right:Nn \l_aw_tab_rows_tl {\\}

% **********************************************************
% **********************************************************




I have try this way but I get some errors:



            /pgf/number format/use comma,%


    \addplot coordinates{%
                        \tl_use:N \l_aw_tab_rows_tl%


\cs_new:Npn \aw_generate_row:n #1
       \tl_put_right:Nn \l_aw_tab_rows_tl {(#1,}
      \tl_put_right:Nn \l_aw_tab_rows_tl {\fp_eval:n{100*{#2}})}

share|improve this question

closed as unclear what you're asking by Joseph Wright Aug 2 '14 at 21:50

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

There aren't answer for this question, because Is it impossible to do? – FormlessCloud Oct 10 '12 at 17:16
I think it's because in order to understand the question, people first have to compile a huge chunk of code without understanding what that code is supposed to do. It's not a minimal example, far from it, which really makes this too localised. – Jake Oct 10 '12 at 17:46
@Jake But this is the minimum code that is required for the functioning of the macro. And I have thinked that the meaning of the macro is explained from the characters table. – FormlessCloud Oct 10 '12 at 19:38
But the actual functionality of the macro has nothing to do with the problem. You could have written a much simpler macro that just generates some random numbers (or something like that), which would make it much easier to determine where the problem lies, and it would make it easier for others who are facing similar problems to see whether this question is relevant. – Jake Oct 10 '12 at 19:49
@Jake You are right, but I haven't write myself this macro, and I don't know how create other similar macro with that language of programming. So I'll try to learn how can I write something like your advice, and update this question. – FormlessCloud Oct 10 '12 at 20:05