Styling part of label in legend in matplotlib
Write between $$ to force matplotlib to interpret it. import matplotlib.pyplot as plt plt.plot(range(10), range(10), label = “Normal text $\it{Italics}$”) plt.legend() plt.show()
Write between $$ to force matplotlib to interpret it. import matplotlib.pyplot as plt plt.plot(range(10), range(10), label = “Normal text $\it{Italics}$”) plt.legend() plt.show()
It’s easier to group them like this when data is in a long format vice wide. Starting with your vectors: DF2 <- data.frame( x = c(c(A1, A2, A3), c(B1, B2, B3)), y = rep(c(“A”, “B”), each = 15), z = rep(rep(1:3, each=5), 2), stringsAsFactors = FALSE ) str(DF2) # ‘data.frame’: 30 obs. of 3 variables: … Read more
You can not modify UISwitch control unless and until you write your own control, But best way so far, you can used UISegmentControl and handle event on it to switch the on.png and off.png images. UISegmentedControl* switchView=[[UISegmentedControl alloc] initWithItems:[[[NSMutableArray alloc] initWithObjects:@”On”,@”Off”,nil] autorelease]]; [switchView setFrame:CGRectMake(20,365,140,28)]; switchView.selectedSegmentIndex=0; switchView.segmentedControlStyle=UISegmentedControlStyleBar; [switchView setImage:[UIImage imageNamed:@”onSelected.png”] forSegmentAtIndex:0]; [switchView setImage:[UIImage imageNamed:@”off.png”] forSegmentAtIndex:1]; [switchView … Read more
This method is for an older version of Bootstrap – Version 2.3.1 Click this link to customize bootstrap: http://twitter.github.com/bootstrap/customize.html You will find examples such as this. Change the parameters to fit your needs. 16 Grid system with Gutter @gridColumns: 16 @gridColumnWidth: 45px @gridGutterWidth: 15px @gridColumnWidth1200: 52.5px @gridGutterWidth1200: 22.5px @gridColumnWidth768: 31.5px @gridGutterWidth768: 15px 16 Grid system … Read more
Thanks to those who suggested Resharper. This gives me another reason to love it even more. Just to be specific about where this lives – JetBrains call it CamelHumps (cute) and you can switch it on using the menu: Resharper -> Options -> Environment -> Editor -> Editor Behavior -> Use CamelHumps … in older … Read more
This is possible starting in iOS 5.0 by subclassing the abstract class UIPopoverBackgroundView and assigning your subclass to the popoverBackgroundViewClass property on your UIPopoverController instance. Unfortunately there is no tintColor property as the popover needs to use images for it’s arrow and border in order to achieve smooth animations during dynamic resizing. You can learn … Read more
To add custom attributes you need to do three things: Add attributes to admin console Add claim mapping Access claims The first one is explained pretty good here: https://www.keycloak.org/docs/latest/server_admin/index.html#user-attributes Add claim mapping: Open the admin console of your realm. Go to Clients and open your client This only works for Settings > Access Type confidential … Read more
create toggle_selector.xml in res/drawable <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/toggle_on” android:state_checked=”true”/> <item android:drawable=”@drawable/toggle_off” android:state_checked=”false”/> </selector> apply the selector to your toggle button <ToggleButton android:id=”@+id/chkState” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:background=”@drawable/toggle_selector” android:textOff=”” android:textOn=””/> Note: for removing the text i used following in above code textOff=”” textOn=””
######################################################### ## customize Title bar ## dotpy.ir ## [email protected] ######################################################### import sys from PyQt4 import QtGui from PyQt4 import QtCore from PyQt4.QtCore import Qt class TitleBar(QtGui.QDialog): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setWindowFlags(Qt.FramelessWindowHint); css = “”” QWidget{ Background: #AA00AA; color:white; font:12px bold; font-weight:bold; border-radius: 1px; height: 11px; } QDialog{ Background-image:url(‘img/titlebar bg.png’); font-size:12px; color: black; } QToolButton{ … Read more
Just customize the text field itself. I am simply doing this and it works fine for me (iOS 7). UITextField *txfSearchField = [_searchBar valueForKey:@”_searchField”]; txfSearchField.backgroundColor = [UIColor redColor]; This way you don’t need to create an image, size it, etc…