i have problem in writing text in 16pt title along with 12pt text throughout the section in overleaf??/ - text

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb} \usepackage[square,numbers]{natbib} \usepackage{graphicx} \usepackage{hyphenat} \usepackage{mathptmx} \usepackage{tgtermes} \usepackage{parskip} \usepackage[arrowdel]{physics} \usepackage{multicol} \usepackage{fontspec} \usepackage{tocloft} \usepackage{ragged2e} \usepackage[english]{babel} \usepackage{geometry} \setmainfont{Times New Roman} \newgeometry{top=2.5cm, right=2.5cm, bottom=2.5cm, left=3.5cm} \setlength{\columnsep}{1cm} \renewcommand\cftloftitlefont{\Large} \renewcommand\cftfigfont{\Large} \renewcommand\cftfigpagefont{\Large} \linespread{1.25} \pagenumbering{roman} \date{} \title{\textbf{\Large ELECTRONIC AND MAGNETIC PROPERTIES OF HALF HEUSLER ALLOY CoMnSb}}`
I want title of my all pages to be 16pt (here \Large with \documentclass[12pt] gives me 17pt title fontsize for ELECTRONIC AND MAGENTIC PROPERTIES OF HALF HEUSLER ALLOY CoMnSb)

Related

Pie Chart with Labels and facet in altair: not able to proper render the value labels

Using the single chart example, I have a label for each piece of cake.
If I try to transform it in a faceted chart using this code
df=pd.read_csv("input.csv",keep_default_na=False)
base=alt.Chart(df).encode(
theta=alt.Theta(field="v", type="quantitative"),
color=alt.Color(field="k", type="nominal")
)
pie = base.mark_arc(outerRadius=100)
text = base.mark_text(radius=115,fill= "black").encode(alt.Text(field="v", type="quantitative", format=",.1f"))
alt.layer(pie, text, data=df).facet(column='label')
all the labels are all in the same wedge and then illegible (here the vega lite version vega lite version).
how to have a result similar to that of the single chart?
Thank you
f,n,k,v,label
1,3,0-5 %,99.7289972899729,Forest
1,4,5-10 %,0.27100271002710025,Forest
0,1,0-5 %,100.0,Non-Forest
254,5,0-5 %,99.0077177508269,unclassifiable
254,6,5-10 %,0.9922822491730982,unclassifiable
I must add:
stack=True as channel encoding option in the theta channel encoding;
and .resolve_scale( theta="independent" ) to the chart.
And it works (I learned this thanks to Mattijn van Hoek).
df=pd.read_csv("input.csv",keep_default_na=False)
base=alt.Chart(df).encode(
theta=alt.Theta(field="v", type="quantitative", stack=True),
color=alt.Color(field="k", type="nominal")
)
pie = base.mark_arc(outerRadius=100)
text = base.mark_text(radius=115,fill= "black").encode(alt.Text(field="v", type="quantitative", format=",.1f"))
alt.layer(pie, text, data=df).facet(column='label').resolve_scale(theta="independent")

How to scale a barplot in tikz without scaling the text?

I have a barplot in latex in tikz, that I want to scale (reduce width, increase length), but without the text having the same effect.
\begin{figure}
\centering
\resizebox{0.8\textwidth}{1.3\textwidth}{
\begin{tikzpicture}
\pgfplotsset{every tick label/.append style={font=\tiny}}
\begin{axis}[ xmajorgrids=true,
xbar, xmin=0,
xlabel={Gini Coefficient, OECD Countries \%},
symbolic y coords={{Australia},{Austria},{Belgium},{Canada},{Chile},{Costa Rica},{Czech Republic},{Denmark},{Estonia},{Finland},{France},{Germany},{Greece},{Hungary},{Iceland},{Ireland},{Israel},{Italy},{Japan},{Korea},{Latvia},{Lithuania},{Luxembourg},{Mexico},{Netherlands},{New Zealand},{Norway},{Poland},{Portugal},{Slovak Republic},{Slovenia},{South Africa},{Spain},{Sweden},{Switzerland},{Turkey},{United Kingdom},{United States}},
ytick=data,
nodes near coords, nodes near coords align={horizontal},
ytick=data,
]
\addplot[fill=blue!90,draw=black!70,tickwidth = 0pt,bar width=4pt,label style={font=\small}, tick label style={font=\small}] coordinates {(0.33,{Australia}) (0.284,{Austria}) (0.266,{Belgium}) (0.307,{Canada}) (0.454,{Chile}) (0.48,{Costa Rica}) (0.253,{Czech Republic}) (0.263,{Denmark}) (0.314,{Estonia}) (0.266,{Finland}) (0.291,{France}) (0.294,{Germany}) (0.333,{Greece}) (0.288,{Hungary}) (0.255,{Iceland}) (0.297,{Ireland}) (0.344,{Israel}) (0.328,{Italy}) (0.339,{Japan}) (0.355,{Korea}) (0.346,{Latvia}) (0.378,{Lithuania}) (0.304,{Luxembourg}) (0.458,{Mexico}) (0.285,{Netherlands}) (0.349,{New Zealand}) (0.262,{Norway}) (0.284,{Poland}) (0.331,{Portugal}) (0.241,{Slovak Republic}) (0.244,{Slovenia}) (0.62,{South Africa}) (0.341,{Spain}) (0.282,{Sweden}) (0.296,{Switzerland}) (0.404,{Turkey}) (0.351,{United Kingdom}) (0.391,{United States})};
\end{axis}
\end{tikzpicture}
}
\caption{\small{Gini coefficient, OECD countries, 2017 or latest available, source: \url{https://data.oecd.org/inequality/income-inequality.htm}}}
\label{fig:giniOECD}
\end{figure}
I would like the bar charts a bit further apart to each other, the blank areas on top and at the end to be removed, the markers (text within the chart that show the values) to be smaller and all the text to be at normal scale, not skewed like that.
Never ever use \resizebox (or \scalebox) for things that contain text.
to set the height and the width of a pgfplot, the height and width keywords can be used
don't put formatting instructions in arguments of macros like \caption. If you want the caption in another font size, you can adjust it with the help of the caption package
\documentclass{article}
\usepackage{pgfplots}
\usepackage{hyperref}
\usepackage[font=small]{caption}
\begin{document}
\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\pgfplotsset{%
width=.8\textwidth,
height=1.5\textwidth
}
\begin{axis}[
xmajorgrids=true,
xbar,
xmin=0,
xlabel={Gini Coefficient, OECD Countries \%},
symbolic y coords={{Australia}, {Austria}, {Belgium}, {Canada}, {Chile}, {Costa Rica}, {Czech Republic}, {Denmark}, {Estonia}, {Finland}, {France}, {Germany}, {Greece}, {Hungary}, {Iceland}, {Ireland}, {Israel}, {Italy}, {Japan}, {Korea}, {Latvia}, {Lithuania}, {Luxembourg}, {Mexico}, {Netherlands}, {New Zealand}, {Norway}, {Poland}, {Portugal}, {Slovak Republic}, {Slovenia}, {South Africa}, {Spain}, {Sweden}, {Switzerland}, {Turkey}, {United Kingdom}, {United States}},
ytick=data,
nodes near coords,
nodes near coords align={horizontal},
enlarge y limits=0.02,
]
\addplot[fill=blue!90,draw=black!70,tickwidth = 0pt,bar width=4pt,label style={font=\small}, tick label style={font=\small}] coordinates {(0.33,{Australia}) (0.284,{Austria}) (0.266,{Belgium}) (0.307,{Canada}) (0.454,{Chile}) (0.48,{Costa Rica}) (0.253,{Czech Republic}) (0.263,{Denmark}) (0.314,{Estonia}) (0.266,{Finland}) (0.291,{France}) (0.294,{Germany}) (0.333,{Greece}) (0.288,{Hungary}) (0.255,{Iceland}) (0.297,{Ireland}) (0.344,{Israel}) (0.328,{Italy}) (0.339,{Japan}) (0.355,{Korea}) (0.346,{Latvia}) (0.378,{Lithuania}) (0.304,{Luxembourg}) (0.458,{Mexico}) (0.285,{Netherlands}) (0.349,{New Zealand}) (0.262,{Norway}) (0.284,{Poland}) (0.331,{Portugal}) (0.241,{Slovak Republic}) (0.244,{Slovenia}) (0.62,{South Africa}) (0.341,{Spain}) (0.282,{Sweden}) (0.296,{Switzerland}) (0.404,{Turkey}) (0.351,{United Kingdom}) (0.391,{United States})};
\end{axis}
\end{tikzpicture}
\caption{Gini coefficient, OECD countries, 2017 or latest available, source: \url{https://data.oecd.org/inequality/income-inequality.htm}}
\label{fig:giniOECD}
\end{figure}
\end{document}

Bumbling around plotting two sets of seasonal data on the same chart

I have series of monthly inventory data since 2017.
I have a series of inventory_forecasts since Dec2018
I am trying to plot the inventory data on a monthly-seasonal basis, and then overlay the inventory_forecasts of Jan2019 through Dec2019.
The dataframe looks like:
The first way I tried to make the chart does show all the data I want, but I'm unable to control the color of the inventory_zj line. Its color seems to be dominated by the color=year(date):N of the alt.Chart I configured. It is ignoring the color='green' I pass to the mark_line()
base = alt.Chart(inv.loc['2000':].reset_index(), title=f"usa total inventory").mark_line().encode(
x='month',
y="inventory",
color="year(date):N"
)
#this ignores my 'green' color instruction, and marks it the same light blue 2019 color
joe = base.mark_line(color='green').encode(
alt.Y('inventory_zj', scale=alt.Scale(zero=False), )
)
base+joe
I tried to use a layering system, but it's not working at all -- I cannot get it to display the "joe" layer
base = alt.Chart(inv.loc['2000':].reset_index(), title=f"usa total inventory").encode(
x='month(date)'
)
doe = base.mark_line().encode(
alt.Y('inventory', scale=alt.Scale(zero=False), ),
color="year(date):N"
)
joe = base.mark_line(color="green").encode(
alt.Y('inventory_zj', scale=alt.Scale(zero=False), ),
)
#looks identical to the first example
alt.layer(
doe, joe
).resolve_scale(
y='shared'
).configure_axisLeft(labelColor='black').configure_axisRight(labelColor='green',titleColor='green')
#independent shows a second y-axis (which is different from the left y-axis) but no line
alt.layer(
doe, joe
).resolve_scale(
y='independent'
).configure_axisLeft(labelColor='black').configure_axisRight(labelColor='green',titleColor='green')
I feel like i must be trying to assemble this chart in a fundamentally wrong way. I should be able to share teh same left y-axis, have the historic data colored by its year, and have a unique color for the 2019-forecasted data. But I seem to be making a mess of it.
As mentioned in the Customizing Visualizations docs, there are multiple ways to specify things like line color, with a well-defined hierarchy: encodings override mark properties, which override top-level configurations.
In your chart, you write base.mark_point(color='green'), where base contains a color encoding which overrides the mark property. If you don't derive the layer from base (so that it does not have a color encoding), then the line will be green as you hoped. Something like this:
base = alt.Chart(inv.loc['2000':].reset_index(), title=f"usa total inventory")
inventory = base.mark_line().encode(
x='month',
y="inventory",
color="year(date):N"
)
joe = base.mark_line(color='green').encode(
x='month',
y=alt.Y('inventory_zj', scale=alt.Scale(zero=False))
)
inventory + joe

how to set two different text color in single textview

i have this
DISCLAIMER:Next Vision Research Solutions Pvt. Ltd. holds the right of refusal/cancel/acceptance of the junk responses either intentionally or unintentionally submitted by anyone and Next Vision Research Solutions Pvt. Ltd. will not be held liable to pay for any such junk responses. Payment shall be made only after ensuring the quality /authenticity on certain parameters of the submitted responses. We are bound to ensure 100 % quality across India with zero tolerance on fudging.नेक्स्ट विज़न रिसर्च सॉल्यूशन्स प्राइवेट लिमिटेड किसी भी प्रकार के जाने या अनजाने में डाले गई गलत प्रतिक्रियाओं को स्वीकृति ना देने का अधिकार रखते है एवं ऐसे किसी भी गलत प्रतिकियॉ का कुछ भी भुगतान करने के लिए बाध्य नहीं है।"
and i want to show this in single text view but in different color like DISCLAIMER: is in red color and other remaining text in black color.
is it possible without using more text view?
please if any possible solution is there tell me.
You can use Spannable to achieve your desire effect.
TextView textView;
String sampleText = "This is <font color='#ff0000'>DISCLAIMER:</font>. Rest of your text or <font color='#00ff00'>Green color</font>.";
// You can use color='red' or color='green'
textView.setText(Html.fromHtml(sampleText), TextView.BufferType.SPANNABLE);
Edit
Define a string in string.xml
<string name="sample_text" formatted="false"><![CDATA[
<font color=\"red\">DISCLAIMER:</font>
<font color=\"#000000\">
Rest of your text in black color
</font>.
]]></string>
Inside your activity/fragment class
TextView tvSample = /*initialize your text view*/;
String text = getString(R.string.sample_text);
tvSample.setText(Html.fromHtml(text), TextView.BufferType.SPANNABLE);

Big gaps, spaces between words in uiLabel text

I have made a uiLabel with a one single word as the text/title. The label is very long and turned 90 deg. It is added to a scrollView so you can see it all eventually.
My problem is; my text is centred, so i only see the word after scrolling down for a while. I need multiple copies of the word in my .text string with nice big spaces between them, so I can see the word on screen most of the time.
Is there a nice format to 'push' words apart like this without having to type in hundreds of spaces?
e.g. #"Label Title /big space/ Label Title /big space/ Label Title /big space/ Label Title"
I have got an idea. You can initialize the NSString variable used to set the title by using
[[NSString alloc] intiWithFormat:#"%# %# %# %#", string1,string2,string3 string4];

Resources