Have Both \filldraw and Theta Marked on Graph

  • MHB
  • Thread starter Dustinsfl
  • Start date
In summary, the code changed to \filldraw[left color=gray,right color=green, draw=green!50!black] (0,0) -- (3mm,0mm) arc (0:30:4mm) -- cycle; and the output looks like the one in the preview.
  • #1
Dustinsfl
2,281
5
Since I have theta marked on the graph, fill draw doesn't show anymore. How can I have both?
Code:
\filldraw[left color=gray,right color=green, draw=green!50!black] -- (3mm,0mm) arc (0:30:4mm) -- cycle;
\draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis); 
\draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis);
\draw (0,0) circle (1cm);
\foreach \x in {-1,1}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor = north] {$\x$};
\foreach \y in {-1,1}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor = east] {$\y$};
\draw -- node[right = .5 pt] {$\theta$}(0.9,0.35);
\draw[very thick, black] (0,0) -- (.70710678,.70710678);
 
Physics news on Phys.org
  • #2
dwsmith said:
Since I have theta marked on the graph, fill draw doesn't show anymore. How can I have both?
Code:
\filldraw[left color=gray,right color=green, draw=green!50!black] -- (3mm,0mm) arc (0:30:4mm) -- cycle;
\draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis); 
\draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis);
\draw (0,0) circle (1cm);
\foreach \x in {-1,1}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor = north] {$\x$};
\foreach \y in {-1,1}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor = east] {$\y$};
\draw -- node[right = .5 pt] {$\theta$}(0.9,0.35);
\draw[very thick, black] (0,0) -- (.70710678,.70710678);

Hi dwsmith, :)

I checked your code, and to me the command \filldraw seem to work, although I am not sure as to what you expect out of it. What part of the circle do you want to color?

Kind Regards,
Sudharaka.
 
  • #3
Sudharaka said:
Hi dwsmith, :)

I checked your code, and to me the command \filldraw seem to work, although I am not sure as to what you expect out of it. What part of the circle do you want to color?

Kind Regards,
Sudharaka.

https://www.physicsforums.com/attachments/352

See page 6 and you will see that fill draw didn't work.
 
  • #4
dwsmith said:
https://www.physicsforums.com/attachments/352

See page 6 and you will see that fill draw didn't work.

I understand the problem now. For some reason I saw the desired output in the preview but not in the pdf file. I have changed the code(highlighted in red) and hope it works now. :) Is this the intended output?
Code:
\begin{tikzpicture}\filldraw[left color=gray,right color=green, draw=green!50!black] [COLOR=#ff0000](0,0) [/COLOR]-- (3mm,0mm) arc (0:30:4mm) -- cycle;\draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis); 

\draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis);
\draw (0,0) circle (1cm);
\foreach \x in {-1,1}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor = north] {$\x$};
\foreach \y in {-1,1}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor = east] {$\y$};
\draw -- node[right = .5 pt] {$\theta$}(0.9,0.35);
\draw[very thick, black] (0,0) -- (.70710678,.70710678);\end{tikzpicture}
 
  • #5


In order to have both \filldraw and theta marked on the graph, you can use the \filldraw command to fill the desired area on the graph and then use the \draw command to draw the theta symbol at the desired location. This way, both the desired area and the theta symbol will be visible on the graph. Alternatively, you can also use the \node command to add the theta symbol to the graph.
 

Related to Have Both \filldraw and Theta Marked on Graph

What is the purpose of having both \filldraw and Theta marked on a graph?

The purpose of having both \filldraw and Theta marked on a graph is to visually represent the relationship between two variables. The \filldraw command is used to fill in a specific area on the graph, while the Theta mark is used to denote a particular angle or direction. Together, they provide a more comprehensive understanding of the data being presented.

How do you determine the value of Theta on a graph?

The value of Theta on a graph is determined by measuring the angle or direction indicated by the Theta mark. This can be done using a protractor or by estimating the angle based on the positioning of the mark on the graph.

What does the area filled by \filldraw represent on a graph?

The area filled by \filldraw represents a specific data point or range of data points on the graph. This can be used to highlight a particular data set or to compare the relationship between two variables at a specific point in the graph.

Can \filldraw and Theta be used on any type of graph?

Yes, \filldraw and Theta can be used on any type of graph. These commands are commonly used in mathematics, science, and engineering fields to visually represent data and relationships between variables.

Is there a specific order in which \filldraw and Theta should be marked on a graph?

No, there is no specific order in which \filldraw and Theta should be marked on a graph. However, it is important to ensure that the marks are clearly labeled and accurately represent the data being presented.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
784
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • Poll
  • General Math
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Replies
4
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
3K
Back
Top