Tutorial. MAKE BETTER, PRETTIER BAR GRAPHS. [ Word Count: 700, ~ 3 PAGES | Revised: 2019.9.4 ]
BLOG
Today sharing:
Some code that I thought it worth sharing.
It draws what (I think) are pleasing bar graphs.
Just realized that most people here don't know you can whip out a bar graph to put somewhere without leaving the browser...
HOW TO USE
To use you can install LaTeX. Or you can use Overleaf.com, for example, if you don't want to install anything; both will produce a pdf document.
Many people find using LaTeX difficult, but to grok it well, you merely need some better examples.
CODE
% IF YOU DO NOT WANT TO INSTALL LaTeX AND USE IT TO COMPILE SUCH CODE YOU CAN MAKE A FEW CHANGES TO THIS CODE AS DESCRIBED BELOW AND USE OVERLEAF.COM TO COMPILE A FILE.PDF
\documentclass[12pt,letterpaper,onecolumn,openright]{article} % OR ELSE INSTEAD SET
% OR ELSE INSTEAD SET \documentclass{standalone}
\usepackage{xcolor,pgfplots,tikz}
% AND THEN ALSO WRITE \pgfplotsset{compat=1.14}
% AND THEN ALSO WRITE \usepackage[english]{babel}\usepackage[utf8]{inputenc}\usepackage[T1]{fontenc}
\definecolor{b1}{HTML}{4F84BD}
\definecolor{r1}{HTML}{C0504D}
\definecolor{g1}{HTML}{8DBB79}
\definecolor{p1}{HTML}{9F4C7C}
\begin{document}\begin{tikzpicture}
\begin{axis}[
width = 1.2*\textwidth,
height = 8cm,
major x tick style = transparent,
ybar=2*\pgflinewidth,
bar width=14pt,
ymajorgrids = true,
ylabel = {\fontsize{8}{12}\selectfont P\,E\,R 100 S\,E\,T\,S (\,256 O\,B\,J\,E\,C\,T\,S)},
symbolic x coords={Q\,U\,A\,N\,T\,I\,T\,Y,V\,A\,L\,U\,E\,(\,UNITS X\,),V\,A\,L\,U\,E\,(\,UNITS Y\,)},
xtick = data,
scaled y ticks = false,
enlarge x limits=0.25,
ymin=0,
legend cell align=left,
legend style={
at={(1,1.05)},
anchor=south east,
column sep=1ex
}
]
\addplot[style={b1,fill=b1,mark=none}]
coordinates {%
(Q\,U\,A\,N\,T\,I\,T\,Y,343)
(V\,A\,L\,U\,E\,(\,UNITS X\,),13.72)
(V\,A\,L\,U\,E\,(\,UNITS Y\,),17.97)};
\addplot[style={r1,fill=r1,mark=none}]
coordinates {%
(Q\,U\,A\,N\,T\,I\,T\,Y,124)
(V\,A\,L\,U\,E\,(\,UNITS X\,),27.28)
(V\,A\,L\,U\,E\,(\,UNITS Y\,),37.73)
};
\addplot[style={g1,fill=g1,mark=none}]
coordinates {%
(Q\,U\,A\,N\,T\,I\,T\,Y,28)
(V\,A\,L\,U\,E\,(\,UNITS X\,),12.65)
(V\,A\,L\,U\,E\,(\,UNITS Y\,),16.50)
};
\addplot[style={p1,fill=p1,mark=none}]
coordinates {%
(Q\,U\,A\,N\,T\,I\,T\,Y,5)
(V\,A\,L\,U\,E\,(\,UNITS X\,),50)
(V\,A\,L\,U\,E\,(\,UNITS Y\,),65.5)
};
\legend{%
\textbf{Shorter}\,. . . . . . . .\hspace{1mm}0.04 UNITS,
\textbf{Abcd}\,. . . . . . . . .\hspace{2mm}0.22 UNITS,
\textbf{Efgh}\,. . . . . . . . .\hspace{3mm}0.45 UNITS,
\textbf{Looonger}\,. . . . . .\hspace{2mm}10.0 UNITS%
}
\end{axis}\end{tikzpicture}\end{document}
Pretty easy, what do you think?
ABOUT ME
I'm a scientist who writes science fiction under various names.
◕ ‿‿ ◕ つ
#writing #creativity #science #fiction #novel #publishing #blog
@tribesteemup
@thealliance
@isleofwrite
@freedomtribe
@smg
#technology #cryptocurrency #life #history #philosophy
#communicate #freedom #development #future
UPVOTE ! FOLLOW !
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License Text and images: ©tibra. Disclaimer: This text is a popular, speculative discussion of basic science literature for the sake of discussion and regarding it no warranties of any kind exist. No promise to do anything or that anything is done is involved. Treat it all as mere conjecture about the past and the future. As subject to change. Else text is explicitly described as being fantasy or science fiction. If so, it is just that and then this is a work of fiction. Events, names, places, characters are either imagined or used fictitiously and any resemblance to real events or persons or places is coincidental.
Leave Tutorial. MAKE BETTER, PRETTIER BAR GRAPHS. [ Word Count: 700, ~ 3 PAGES | Revised: 2019.9.4 ] to:
Read more #blog posts
Best Posts From tibra
We have not curated any of tibra's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From tibra
- Outline of a brief introduction to statistics and learning
- Tutorial. MAKE BETTER, PRETTIER BAR GRAPHS. [ Word Count: 700, ~ 3 PAGES | Revised: 2019.9.4 ]
- RANDOM CONJECTURES REGARDING THE DESIGN OF SOCIAL NETWORKS. Part 1. ... [ Word Count: 2.850, ~ 12 PAGES | Revised: 2019.9.3 ]
- HOW TO WORK PRODUCTIVELY WITH THOUSANDS OF REFERENCES TO WRITE PAPERS AND BOOKS: A GUIDE TOGETHER WITH CODE FOR SOME FREE TOOLS TO MAKE LIFE EASIER. ... [ Word Count: 3.000 ~ 12 PAGES | Revised: 2019.5.24 ]
- WHAT CAN BE DONE WITH BLOCKCHAIN BASED TOOLS THAT USE HEURISTICS TO PROVIDE MINIMALISTIC, CONVENIENT INTELLIGENT CAPABILITIES? ... [ Word Count: 1.350 ~ 6 PAGES | Revised: 2019.3.26 ]
- HEURISTICS, REASONING, TAGGING, LEARNING, AND THE FUTURE OF THE SPACE. ... [ Word Count: 1.400 ~ 6 PAGES | Revised: 2018.3.14 ]
- CHANNEL. More thinking about the future of the space. ... [ Word Count: 1.250 ~ 5 PAGES | Revised: 2018.2.9 ]
- PREVIEW. Technical thinking about the future of the space. ... [ Word Count: 2.000 ~ 8 PAGES | Revised: 2018.12.21 ]
- FOOD PHOTOGRAPHY. — BLUEFIN TUNA BELLY RECIPES.
- OPEN CONVERSATION. — REGARDING OPEN SCIENCE AND DEVELOPING FREE IMMUTABLE POST PUBLICATION PEER REVIEW PLATFORMS AND CAPTURING NETWORK EFFECTS. ... [ Word Count: 1.500 ~ 6 PAGES | Revised: 2018.11.15 ]